mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
fix formatting
This commit is contained in:
parent
b6f4737ecc
commit
2b940c9cfb
@ -314,18 +314,19 @@ const CalendarUtils = {
|
||||
duration = 24 * 60 * 60 * 1000;
|
||||
Log.debug("new recurring date is " + date);
|
||||
}
|
||||
} else { // not full day, but luxon can still screw up the date on the rule processing
|
||||
} else {
|
||||
// not full day, but luxon can still screw up the date on the rule processing
|
||||
// get time zone offset of the rule calculated event
|
||||
let dateoffset = date.getTimezoneOffset()
|
||||
let dateoffset = date.getTimezoneOffset();
|
||||
// reduce the time by the offset
|
||||
Log.debug(" recurring date is " + date + " offset is " + dateoffset);
|
||||
let dh = moment(date).format("HH")
|
||||
Log.debug(" recurring date is " + date + " offset is " + dateoffset/60 +" Hour is "+dh);
|
||||
let dh = moment(date).format("HH");
|
||||
Log.debug(" recurring date is " + date + " offset is " + dateoffset / 60 + " Hour is " + dh);
|
||||
|
||||
// we need to correct the date to get back to the right event for
|
||||
if(dateoffset <0){
|
||||
if (dateoffset < 0) {
|
||||
// if the date hour is less than the offset
|
||||
if( (dh) < Math.abs(dateoffset/60)){
|
||||
if (dh < Math.abs(dateoffset / 60)) {
|
||||
// reduce the time by the offset
|
||||
Log.debug(" recurring date is " + date + " offset is " + dateoffset);
|
||||
// apply the correction to the date/time to get it UTC relative
|
||||
@ -337,9 +338,9 @@ const CalendarUtils = {
|
||||
}
|
||||
} else {
|
||||
// if the date hour is less than the offset
|
||||
if( (24-dh) < Math.abs(dateoffset/60)){
|
||||
if (24 - dh < Math.abs(dateoffset / 60)) {
|
||||
// apply the correction to the date/time back to right day
|
||||
date = new Date(date.getTime() + Math.abs(24*60) * 60000);
|
||||
date = new Date(date.getTime() + Math.abs(24 * 60) * 60000);
|
||||
// the duration was calculated way back at the top before we could correct the start time..
|
||||
// fix it for this event entry
|
||||
//duration = 24 * 60 * 60 * 1000;
|
||||
|
Loading…
x
Reference in New Issue
Block a user