Created
March 22, 2024 09:08
-
-
Save leifermendez/5c8bc3bd3ec52edefd86ddda5cb20262 to your computer and use it in GitHub Desktop.
calendar-plus-minutes.js
This file contains hidden or 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
| {{ (() => { | |
| const gap = 45 | |
| const startDate = new Date($json["body"]["startDate"]); | |
| const endDate = new Date(startDate.getTime() + (gap * 60 * 1000)); | |
| const formatNumber = (num) => (num < 10 ? '0' : '') + num; | |
| const formattedDate = endDate.getFullYear() + '/' + | |
| formatNumber(endDate.getMonth() + 1) + '/' + | |
| formatNumber(endDate.getDate()) + ' ' + | |
| formatNumber(endDate.getHours()) + ':' + | |
| formatNumber(endDate.getMinutes()) + ':' + | |
| formatNumber(endDate.getSeconds()); | |
| return formattedDate; | |
| })() }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment