Changeset 12375 for sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-time-shortcode.php
- Timestamp:
- 01/31/2023 06:44:54 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-time-shortcode.php
r12173 r12375 82 82 83 83 parseDate = function( text ) { 84 var m = /^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})\+00:00$/.exec( text ), 85 d = new Date(); 84 var m = /^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})\+00:00$/.exec( text ); 86 85 87 d.setUTCFullYear( + m[1] ); 88 d.setUTCMonth( + m[2] - 1 ); 89 d.setUTCDate( + m[3] ); 90 d.setUTCHours( + m[4] ); 91 d.setUTCMinutes( + m[5] ); 92 d.setUTCSeconds( + m[6] ); 93 94 return d; 86 return new Date( 87 // Date.UTC(year, monthIndex (0..11), day, hour, minute, second) 88 Date.UTC( + m[1], + m[2] - 1, + m[3], + m[4], + m[5], + m[6] ) 89 ); 95 90 }; 96 91
Note: See TracChangeset
for help on using the changeset viewer.