Changeset 1174709
- Timestamp:
- 06/04/2015 07:44:14 PM (11 years ago)
- Location:
- wp-stardate/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (3 diffs)
-
stardate.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-stardate/trunk/readme.txt
r1161885 r1174709 4 4 Requires at least: 4.0.1 5 5 Tested up to: 4.2.2 6 Stable tag: 1.0 6 Stable tag: 1.0.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 17 17 * Filter various date functions, to have them display stardate instead, or filter nothing at all, and use the... 18 18 * `<?php the_stardate() ?>` function (or `<?pgp get_the_stardate() ?>`) inside of your themes, to get posts stardate. 19 * Aapproximate stardate based on several different formulas and variants and sources (like trekguide and wikipedia), including XI (for modern movies) as well as Classic (from TNG, VOY ...).19 * Aapproximate stardate based on several different formulas and variants and sources (like trekguide and wikipedia), including XI (for modern movies), Star Trek Online, as well as Classic (from TNG, VOY ...). 20 20 * Shortcodes: `[stardate]` will expand to the current timestamp in stardate fmt. 21 21 … … 39 39 == Changelog == 40 40 41 = 1.0.1 = 42 Added Star Trek Online (SOL) stardate fmt. from comment by MartinSayles 43 41 44 = 1.0 = 42 45 Initial release. -
wp-stardate/trunk/stardate.php
r1174702 r1174709 220 220 $stardate = mysql2date("Y.z", $date); 221 221 } elseif ($style == 'SOL') { 222 /* Represent the current date in YYMM.DD format, where "YY" is the current year minus 1900,223 * MM is the current month (01-12), and DD is the current day of the month (01-31).222 /* 223 * Added from comment by MartinSayles, 224 224 */ 225 225 $yy = mysql2date("Y", $date); … … 236 236 237 237 $dd = $day_of_year / 365.2422 * 1000; 238 $ff = ($dd - (int)$dd) * 100; 238 $ff = ($dd - (int)$dd) * 100; // TODO: Fix this later 239 239 $stardate = sprintf("%s%03s.%01s", $yy, (int)$dd, (int)$ff); 240 240 } else {
Note: See TracChangeset
for help on using the changeset viewer.