Continued work on media schedule panel.

This commit is contained in:
rainbow napkin 2025-02-02 18:49:20 -05:00
parent d5a2a51be2
commit 90be85de26
6 changed files with 475 additions and 103 deletions

View file

@ -36,6 +36,20 @@ class canopyUtils{
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
isSameDate(d0, d1){
return d0.getYear() == d1.getYear() && d0.getMonth() == d1.getMonth() && d0.getDate() == d1.getDate();
}
dateWithinRange(min, max, input){
return min.getTime() < input.getTime() && max.getTime() > input.getTime();
}
}
class canopyUXUtils{
constructor(){
}
async awaitNextFrame(){
//return a new promise
return new Promise((resolve)=>{
@ -49,11 +63,18 @@ class canopyUtils{
});
})
}
}
class canopyUXUtils{
constructor(){
}
//Useful for pesky date/time input conversions
localizeDate(date){
//Apply timezone offset to base (utc) time
return new Date(date.getTime() - (date.getTimezoneOffset() * 60000));
}
//Useful for pesky date/time input conversions
normalizeDate(date){
//Convert dates which store local time to utc to dates which store utc as utc
return new Date(date.getTime() + (date.getTimezoneOffset() * 60000));
}
//Update this and popup class to use nodes
//and display multiple errors in one popup