Changeset 7977
- Timestamp:
- 12/17/2018 07:34:19 AM (7 years ago)
- Location:
- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt
- Files:
-
- 2 edited
-
javascript/tracker/source/tracker.jsx (modified) (1 diff)
-
wcpt-event/tracker.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/javascript/tracker/source/tracker.jsx
r7976 r7977 13 13 * Looks like exact javascript convert of WordPress's human_time_diff, except this always compares from current time, instead of getting two arguments. 14 14 * 15 * @param {int} date Unix timestamp date to compare from15 * @param {int} seconds Seconds ago to convert to human readable time 16 16 * 17 17 * @returns {string} Human readable time ago 18 18 */ 19 const timeSince = ( date ) => { 20 21 const seconds = Math.floor( (new Date() / 1000 ) - date ); 19 const timeSince = ( seconds ) => { 22 20 23 21 let interval = Math.floor(seconds / 31536000); -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-event/tracker.php
r7976 r7977 70 70 'milestone' => $milestones[ $post->post_status ], 71 71 'status' => $statuses[ $post->post_status ], 72 'lastUpdate' => $last_update_timestamp,72 'lastUpdate' => time() - $last_update_timestamp, 73 73 ); 74 74 }
Note: See TracChangeset
for help on using the changeset viewer.