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
| /** | |
| * @param {String} email | |
| * @return {Boolean} | |
| */ | |
| const validateEmail = email => { | |
| const emailRegex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
| return emailRegex.test(email); | |
| }; |
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
| let bodyBlocked = false; | |
| const { body, documentElement: html } = document; | |
| export const blockScroll = () => { | |
| if (bodyBlocked) { | |
| return; | |
| } | |
| const scrollBarWidth = window.innerWidth - html.clientWidth; |
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
| function getRemainingTime(endtime) { | |
| if (typeof endtime !== 'object') { | |
| throw new Error('getRemainingTime expects a Date object'); | |
| } | |
| const total = Date.parse(endtime) - Date.parse(new Date()); | |
| return { | |
| total: total, | |
| days: Math.floor(total / (1000 * 60 * 60 * 24)), |
NewerOlder