Changeset 3302159
- Timestamp:
- 05/28/2025 11:17:47 AM (10 months ago)
- Location:
- wordpress-hebrew-date
- Files:
-
- 10 added
- 2 edited
-
tags/2.0.5 (added)
-
tags/2.0.5/default.pot (added)
-
tags/2.0.5/heb_date.php (added)
-
tags/2.0.5/hebdate-he_IL.mo (added)
-
tags/2.0.5/hebdate-he_IL.po (added)
-
tags/2.0.5/old_functions.php (added)
-
tags/2.0.5/readme.txt (added)
-
tags/2.0.5/screenshot-1.png (added)
-
tags/2.0.5/screenshot-2.png (added)
-
tags/2.0.5/screenshot-3.png (added)
-
trunk/heb_date.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wordpress-hebrew-date/trunk/heb_date.php
r3039402 r3302159 4 4 Plugin URI: https://hatul.info/hebdate/ 5 5 Description: Convert dates in wordpress to Hebrew dates. 6 Version: 2.0. 4.16 Version: 2.0.5 7 7 Author: Hatul 8 8 Author URI: https://hatul.info … … 276 276 } 277 277 278 //if the time after the sunset return tommrow 279 function sunset($date){ 280 $date = mysql2date("H-i-s-j-n-Y", $date); 281 list($hour, $min, $sec, $day, $mon, $year) = explode('-', $date); 282 $suninfo = date_sun_info(mktime($hour, $min, 0, $day, $mon, $year), get_option('latitude'), get_option('longitude')); 283 284 if (! $suninfo){ 278 //if the time after the sunset return tomorrow 279 function sunset($date) { 280 $dt = new DateTime($date, wp_timezone()); 281 282 $lat = get_option('latitude'); 283 $lng = get_option('longitude'); 284 285 if (! $lat || ! $lng) { 285 286 return $date; 286 287 } 287 288 288 $sunset = date('H:i', $suninfo['sunset']); 289 list($sunset_h, $sunset_m) = explode(':', $sunset); 290 291 if ($hour > $sunset_h || ($hour == $sunset_h && $min > $sunset_m)){ 292 $date = gregoriantojd($mon, $day, $year) + 1; 293 $date = jdtogregorian($date); 294 list($mon, $day, $year) = explode('/', $date); 295 } 296 $date = $hour . ':' . $min . ':' . $sec . ' ' . $year . '-' . $mon . '-' . $day; 297 298 return apply_filters('hebdate_sunset', $date); 289 $suninfo = date_sun_info($dt->getTimestamp(), $lat, $lng); 290 if (! $suninfo || ! isset($suninfo['sunset'])) { 291 return $date; 292 } 293 294 $sunset = new DateTime(); 295 $sunset->setTimestamp($suninfo['sunset']); 296 $sunset->setTimezone(wp_timezone()); 297 298 if ($dt > $sunset) { 299 $dt->modify('+1 day'); 300 } 301 302 return apply_filters('hebdate_sunset', $dt->format('Y-m-d H:i:s')); 299 303 } 300 304 -
wordpress-hebrew-date/trunk/readme.txt
r3282613 r3302159 4 4 Tags: hebrew, date, jewish 5 5 Requires at least: 2.0 6 Tested up to: 6. 87 Stable tag: 2.0. 4.16 Tested up to: 6.1 7 Stable tag: 2.0.5 8 8 9 9 Convert dates in wordpress to Hebrew dates. … … 34 34 35 35 == Changelog == 36 = 2.0.5 = 37 * Fix sunset bug 36 38 = 2.0.4 = 37 39 * Update date_sunset to date_sunset
Note: See TracChangeset
for help on using the changeset viewer.