Created
July 9, 2019 20:19
-
-
Save vitalybe/bced231d551ee6ffd425f04c8935e553 to your computer and use it in GitHub Desktop.
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 formatDate(date) { | |
const hour = date.getHours(); | |
const minute = date.getMinutes(); | |
const second = date.getSeconds(); | |
return (`${hour}:${minute}:${second}`); | |
} | |
const prettyDate = useMemo(() => formatDate(currentDate), [currentDate]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment