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
function formatTimeByHowRecent(rawTimestamp) { | |
var currentDate = new Date(); | |
//reference times for different displays | |
var ref = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate(), 0, 0, 0); | |
var refday = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate(), 0, 0, 0); | |
var refdayNext = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate(), 0, 0, 0); | |
var refweek = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate(), 0, 0, 0); | |
refday.setDate(ref.getDate() - 1); | |
refdayNext.setDate(ref.getDate() + 1); | |
refweek.setDate(ref.getDate() - 7); |
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
// OPTION A | |
// Handle error/help display logic at the input's parent level | |
submit() { | |
this.setState({ | |
emailHasBeenBlurred: true, | |
pwHasBeenBlurred: true | |
}) | |
if (validator.email(this.state.value).help || |