Merge branch 'yo-less-patch-2' into develop

This commit is contained in:
Michael Teeuw
2016-09-01 09:39:34 +02:00
3 changed files with 16 additions and 2 deletions

View File

@@ -150,6 +150,16 @@ Module.register("calendar",{
timeWrapper.innerHTML = this.translate("TODAY");
} else if (event.startDate - now < one_day && event.startDate - now > 0) {
timeWrapper.innerHTML = this.translate("TOMORROW");
} else if (event.startDate - now < 2*one_day && event.startDate - now > 0) {
/*Provide ability to show "the day after tomorrow" instead of "in a day"
*if "DAYAFTERTOMORROW" is configured in a language's translation .json file,
*,which can be found in MagicMirror/translations/
*/
if (this.translate('DAYAFTERTOMORROW') !== 'DAYAFTERTOMORROW') {
timeWrapper.innerHTML = this.translate("DAYAFTERTOMORROW");
} else {
timeWrapper.innerHTML = moment(event.startDate, "x").fromNow();
}
} else {
/* Check to see if the user displays absolute or relative dates with their events
* Also check to see if an event is happening within an 'urgency' time frameElement