Created
July 30, 2020 18:29
-
-
Save AdSegura/5e813495ffb250d635d83acbaad1f4bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <p class="transform_date" data-date="2020-07-30 18:08:22"></p> | |
$(".transform_date").each(function() { | |
let created_at = $(this).data("date") | |
let ago = moment.tz(created_at, "YYYY-MM-DD HH:mm:ss", "UTC").fromNow(); | |
$(this).html(ago) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment