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 { differenceInYears } = require("date-fns") | |
| // import { differenceInYears } from 'date-fns' | |
| const age = differenceInYears( | |
| Date.now(), | |
| new Date(1996, 07, 26) | |
| ) |
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
| /** | |
| * Traduções para o pacote timeago.js em purtuguês Brasil. | |
| * @see https://timeago.org/ | |
| */ | |
| function timeago_ptBR_locale(number, index, total_sec) { | |
| return [ | |
| ['agora mesmo', 'agora mesmo'], | |
| ['%s segundos atrás', 'em %s segundos'], | |
| ['1 minuto atrás', 'em 1 minuto'], | |
| ['%s minutos atrás', 'em %s minutos'], |
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 daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] | |
| // Company schedule data saved in the database | |
| const weekSchedule = { | |
| 'Sunday': ['07:00 AM - 11:00 AM', '06:00 PM - 11:00 PM'], | |
| 'Monday': null, | |
| 'Tuesday': ['07:00 AM - 11:00 AM', '01:00 PM - 05:00 PM'], | |
| 'Wednesday': ['07:00 AM - 11:00 AM', '01:00 PM - 05:00 PM'], | |
| 'Thursday': ['07:00 AM - 11:00 AM', '01:00 PM - 05:00 PM'], | |
| 'Friday': ['07:00 AM - 11:00 AM', '01:00 PM - 05:00 PM', '06:00 PM - 11:00 PM'], |
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
| /** | |
| * Listen to clicks on an element that matches the selector using only one event defined at root of the document. | |
| * Similar to jQuery .delegate() but faster. | |
| */ | |
| (function() { | |
| const delegationSelectorsMap = {}; | |
| document.addEventListener('click', function (event) { | |
| let element = event.target; | |
| let forceBreak = false; |