Changeset 3674768
- Timestamp:
- 08/31/2026 06:10:32 PM (8 weeks ago)
- Location:
- nepali-bs-date-tools
- Files:
-
- 4 edited
-
tags/1.0.1/bs_dateClass.php (modified) (1 diff)
-
tags/1.0.1/nepali-bs-date-tools.php (modified) (4 diffs)
-
trunk/bs_dateClass.php (modified) (1 diff)
-
trunk/nepali-bs-date-tools.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
nepali-bs-date-tools/tags/1.0.1/bs_dateClass.php
r3669018 r3674768 174 174 $get_totaldays_nepadate = $this->nepali_date_indays( $get_index_nepdate, $nepalidate_arr[1], $nepalidate_arr[2] ); 175 175 176 $date_to_add=strtotime("April 14 1943"); 177 $end = strtotime("+".$get_totaldays_nepadate." days", $date_to_add); 178 $engdate = wp_date("M j Y, l", $end); 179 176 $wp_timezone = wp_timezone(); 177 $date = new DateTime( 'April 14 1943', $wp_timezone ); 178 $days_to_add = (int) $get_totaldays_nepadate; 179 $date->modify( "+{$days_to_add} days" ); 180 $engdate = wp_date( 'M j Y, l', $date->getTimestamp(), $wp_timezone ); 180 181 return esc_html($engdate); 181 182 } 182 183 183 function get_day($totaldays){ 184 185 $date_to_add=strtotime("April 14 1943"); 186 $end = strtotime("+".($totaldays-1)." days", $date_to_add); 187 $day = wp_date("w", $end); 188 189 return $day; 184 function get_day($totaldays){ 185 186 $wp_timezone = wp_timezone(); 187 $date = new DateTime( 'April 14 1943', $wp_timezone ); 188 $days_to_add = $totaldays - 1; 189 $date->modify( "+{$days_to_add} days" ); 190 return $date->format( 'w' ); 191 190 192 } 191 193 -
nepali-bs-date-tools/tags/1.0.1/nepali-bs-date-tools.php
r3669018 r3674768 66 66 global $NBSD_Dateplugin; 67 67 68 $dateto_convert = ( $today_date == '' ? wp_date('Y-m-d', strtotime($post->post_date)) : $today_date );68 $dateto_convert = ( $today_date == '' ? get_post_datetime( $post )->format( 'Y-m-d' ) : $today_date ); 69 69 $nepaliDate = $NBSD_Dateplugin->NBSD_convertTonepalidate( ['engdate' => $dateto_convert] ); 70 70 $nepaliDate = explode(" ", $nepaliDate); … … 102 102 if( $get_bsdate_options['chk_time'] == 1 ){ 103 103 104 $converted_date .= " ".$NBSD_Dateplugin->NBSD_convertTonepalinumber( wp_date('H:i', strtotime($post->post_date)));104 $converted_date .= " ".$NBSD_Dateplugin->NBSD_convertTonepalinumber(get_post_datetime( $post )->format( 'H:i' )); 105 105 } 106 106 } … … 120 120 if( $get_bsdate_options['chk_time'] == 1 ){ 121 121 122 $converted_date .= " ".$NBSD_Dateplugin->NBSD_convertTonepalinumber( wp_date('H:i', strtotime($post->post_date)));122 $converted_date .= " ".$NBSD_Dateplugin->NBSD_convertTonepalinumber(get_post_datetime( $post )->format( 'H:i' )); 123 123 } 124 124 … … 131 131 if( $get_bsdate_options['chk_time'] == 1 ){ 132 132 133 $converted_date .= " ".$NBSD_Dateplugin->NBSD_convertTonepalinumber( wp_date('H:i', strtotime($post->post_date)));133 $converted_date .= " ".$NBSD_Dateplugin->NBSD_convertTonepalinumber(get_post_datetime( $post )->format( 'H:i' )); 134 134 } 135 135 -
nepali-bs-date-tools/trunk/bs_dateClass.php
r3554371 r3674768 174 174 $get_totaldays_nepadate = $this->nepali_date_indays( $get_index_nepdate, $nepalidate_arr[1], $nepalidate_arr[2] ); 175 175 176 $date_to_add=strtotime("April 14 1943"); 177 $end = strtotime("+".$get_totaldays_nepadate." days", $date_to_add); 178 $engdate = wp_date("M j Y, l", $end); 179 176 $wp_timezone = wp_timezone(); 177 $date = new DateTime( 'April 14 1943', $wp_timezone ); 178 $days_to_add = (int) $get_totaldays_nepadate; 179 $date->modify( "+{$days_to_add} days" ); 180 $engdate = wp_date( 'M j Y, l', $date->getTimestamp(), $wp_timezone ); 180 181 return esc_html($engdate); 181 182 } 182 183 183 function get_day($totaldays){ 184 185 $date_to_add=strtotime("April 14 1943"); 186 $end = strtotime("+".($totaldays-1)." days", $date_to_add); 187 $day = wp_date("w", $end); 188 189 return $day; 184 function get_day($totaldays){ 185 186 $wp_timezone = wp_timezone(); 187 $date = new DateTime( 'April 14 1943', $wp_timezone ); 188 $days_to_add = $totaldays - 1; 189 $date->modify( "+{$days_to_add} days" ); 190 return $date->format( 'w' ); 191 190 192 } 191 193 -
nepali-bs-date-tools/trunk/nepali-bs-date-tools.php
r3669018 r3674768 66 66 global $NBSD_Dateplugin; 67 67 68 $dateto_convert = ( $today_date == '' ? wp_date('Y-m-d', strtotime($post->post_date)) : $today_date );68 $dateto_convert = ( $today_date == '' ? get_post_datetime( $post )->format( 'Y-m-d' ) : $today_date ); 69 69 $nepaliDate = $NBSD_Dateplugin->NBSD_convertTonepalidate( ['engdate' => $dateto_convert] ); 70 70 $nepaliDate = explode(" ", $nepaliDate); … … 102 102 if( $get_bsdate_options['chk_time'] == 1 ){ 103 103 104 $converted_date .= " ".$NBSD_Dateplugin->NBSD_convertTonepalinumber( wp_date('H:i', strtotime($post->post_date)));104 $converted_date .= " ".$NBSD_Dateplugin->NBSD_convertTonepalinumber(get_post_datetime( $post )->format( 'H:i' )); 105 105 } 106 106 } … … 120 120 if( $get_bsdate_options['chk_time'] == 1 ){ 121 121 122 $converted_date .= " ".$NBSD_Dateplugin->NBSD_convertTonepalinumber( wp_date('H:i', strtotime($post->post_date)));122 $converted_date .= " ".$NBSD_Dateplugin->NBSD_convertTonepalinumber(get_post_datetime( $post )->format( 'H:i' )); 123 123 } 124 124 … … 131 131 if( $get_bsdate_options['chk_time'] == 1 ){ 132 132 133 $converted_date .= " ".$NBSD_Dateplugin->NBSD_convertTonepalinumber( wp_date('H:i', strtotime($post->post_date)));133 $converted_date .= " ".$NBSD_Dateplugin->NBSD_convertTonepalinumber(get_post_datetime( $post )->format( 'H:i' )); 134 134 } 135 135
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)