Changeset 3263892
- Timestamp:
- 03/29/2025 05:50:52 PM (12 months ago)
- Location:
- nepali-date-converter
- Files:
-
- 34 added
- 4 edited
-
tags/3.0.2 (added)
-
tags/3.0.2/inc (added)
-
tags/3.0.2/inc/class (added)
-
tags/3.0.2/inc/class/index.php (added)
-
tags/3.0.2/inc/class/ndc-frontend.php (added)
-
tags/3.0.2/inc/class/ndc-post-date.php (added)
-
tags/3.0.2/inc/frameworks (added)
-
tags/3.0.2/inc/frameworks/nepali-calendar (added)
-
tags/3.0.2/inc/frameworks/nepali-calendar/index.php (added)
-
tags/3.0.2/inc/frameworks/nepali-calendar/nepali-calendar.php (added)
-
tags/3.0.2/inc/functions (added)
-
tags/3.0.2/inc/functions/functions.php (added)
-
tags/3.0.2/inc/functions/index.php (added)
-
tags/3.0.2/inc/hooks (added)
-
tags/3.0.2/inc/hooks/enqueue-scripts.php (added)
-
tags/3.0.2/inc/hooks/index.php (added)
-
tags/3.0.2/inc/hooks/wp-ajax.php (added)
-
tags/3.0.2/inc/hooks/wp-footer.php (added)
-
tags/3.0.2/inc/index.php (added)
-
tags/3.0.2/inc/init.php (added)
-
tags/3.0.2/inc/shortcode (added)
-
tags/3.0.2/inc/shortcode/index.php (added)
-
tags/3.0.2/inc/shortcode/shortcode-nepali-date-converter.php (added)
-
tags/3.0.2/inc/shortcode/shortcode-today-date.php (added)
-
tags/3.0.2/inc/widgets (added)
-
tags/3.0.2/inc/widgets/index.php (added)
-
tags/3.0.2/inc/widgets/widget-nepali-date-converter.php (added)
-
tags/3.0.2/inc/widgets/widget-today-date.php (added)
-
tags/3.0.2/index.php (added)
-
tags/3.0.2/languages (added)
-
tags/3.0.2/languages/index.php (added)
-
tags/3.0.2/languages/nepali-date-converter.pot (added)
-
tags/3.0.2/nepali-date-converter.php (added)
-
tags/3.0.2/readme.txt (added)
-
trunk/inc/class/ndc-post-date.php (modified) (2 diffs)
-
trunk/inc/frameworks/nepali-calendar/nepali-calendar.php (modified) (1 diff)
-
trunk/nepali-date-converter.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
nepali-date-converter/trunk/inc/class/ndc-post-date.php
r3263606 r3263892 624 624 * @since 2.0.0 625 625 */ 626 public function convert_post_date_to_nepali( string $the_date, string $format, WP_Post $post ): string { 626 public function convert_post_date_to_nepali( $the_date, $format, $post ) { 627 628 if ( ! $the_date || ! $post || ! isset( $post->post_date ) ) { 629 return $the_date; 630 } 631 627 632 // Skip if post type not supported. 628 633 if ( ! in_array( $post->post_type, $this->options['post_types'], true ) ) { … … 665 670 ); 666 671 667 return $nepali_date ['result'];672 return $nepali_date && isset( $nepali_date['result'] ) ? $nepali_date['result'] : $the_date; 668 673 } 669 674 -
nepali-date-converter/trunk/inc/frameworks/nepali-calendar/nepali-calendar.php
r3263606 r3263892 638 638 639 639 $date_str = sprintf( '%d-%d-%d', $year, $month, $day ); 640 if ( $hour ) { 640 641 if ( isset( $hour ) ) { 641 642 $date_str .= sprintf( ' %02d', $hour ); 642 } 643 if ( $min ) { 644 $date_str .= sprintf( ':%02d', $min ); 645 } 646 if ( $sec ) { 647 $date_str .= sprintf( ':%02d', $sec ); 648 } 649 650 $timezone = wp_timezone(); 651 $datetime = new DateTimeImmutable( $date_str, $timezone ); 652 $timestamp = $datetime->getTimestamp(); 643 if ( isset( $min ) ) { 644 $date_str .= sprintf( ':%02d', $min ); 645 if ( isset( $sec ) ) { 646 $date_str .= sprintf( ':%02d', $sec ); 647 } 648 } 649 } 650 651 try { 652 $timezone = wp_timezone(); 653 $datetime = new DateTimeImmutable( $date_str, $timezone ); 654 $timestamp = $datetime->getTimestamp(); 655 } catch ( Exception $e ) { 656 return $input_date; 657 } 653 658 654 659 // Date format replacements. -
nepali-date-converter/trunk/nepali-date-converter.php
r3263606 r3263892 4 4 Plugin URI: https://www.addonspress.com/wordpress-plugins/nepali-date-converter/ 5 5 Description: Convert English to Nepali Date and Vice Versa and Post Date to Nepali Date. 6 Version: 3.0. 16 Version: 3.0.2 7 7 Author: addonspress 8 8 Author URI: https://www.addonspress.com/ … … 17 17 } 18 18 /*Define Constants for this plugin*/ 19 define( 'NEPALI_DATE_CONVERTER_VERSION', '3.0. 1' );19 define( 'NEPALI_DATE_CONVERTER_VERSION', '3.0.2' ); 20 20 define( 'NEPALI_DATE_CONVERTER_PATH', plugin_dir_path( __FILE__ ) ); 21 21 define( 'NEPALI_DATE_CONVERTER_URL', plugin_dir_url( __FILE__ ) ); -
nepali-date-converter/trunk/readme.txt
r3263606 r3263892 6 6 Tested up to: 6.7 7 7 Requires PHP: 7.2 8 Stable tag: 3.0. 18 Stable tag: 3.0.2 9 9 License: GPLv2 or later 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 11 12 12 Convert English dates to Nepali and vice versa, including WordPress post dates. Includes widgets, shortcodes, and custom functions. … … 122 122 == Changelog == 123 123 124 = 3.0.2 - 2025-03-29 = 125 * Fixed: Ensured 0 hour is correctly handled in date formatting 126 * Fixed: Added checks to prevent fatal errors from themes passing invalid date formats 127 124 128 = 3.0.1 - 2025-03-29 = 125 129 * Fixed: Few translation issue
Note: See TracChangeset
for help on using the changeset viewer.