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
{ | |
"bracketSpacing": true, | |
"endOfLine": "lf", | |
"jsxBracketSameLine": false, | |
"printWidth": 120, | |
"semi": false, | |
"singleQuote": true, | |
"tabWidth": 2, | |
"trailingComma": "all", | |
"useTabs": false |
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
{ | |
"env": { | |
"browser": true, | |
"node": true, | |
"es6": true | |
}, | |
"parser": "babel-eslint", | |
"extends": [ | |
"airbnb", | |
"prettier" |
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
root = true | |
[*] | |
charset = utf-8 | |
end_of_line = lf | |
indent_size = 2 | |
indent_style = space | |
insert_final_newline = true | |
trim_trailing_whitespace = true |
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
getGreetingTime = (currentTime, user = null) => { | |
if (!currentTime || !currentTime.isValid()) { return `Hello ${user ? ` ${user}` : ''}`; } | |
const splitAfternoon = 12; // 24hr time to split the afternoon | |
const splitEvening = 17; // 24hr time to split the evening | |
const currentHour = parseFloat(currentTime.format('HH')); | |
let greetingText = 'Good morning'; // Between dawn and noon | |
if (currentHour >= splitAfternoon && currentHour <= splitEvening) { | |
// Between 12 PM and 5PM |