Changeset 7977 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/javascript/tracker/source/tracker.jsx
- Timestamp:
- 12/17/2018 07:34:19 AM (7 years ago)
- File:
-
- 1 edited
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);
Note: See TracChangeset
for help on using the changeset viewer.