This commit is contained in:
@@ -537,6 +537,33 @@ export default {
|
||||
|
||||
return new Date(value) < new Date();
|
||||
},
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// parse UTC ISO 8601 strings, compare
|
||||
// if(d1 is less than d2 )
|
||||
d1IsBeforeD2FromUTC8601String(d1, d2) {
|
||||
if (!d1 || d1 == "" || !d2 == null || d2 == "") {
|
||||
throw new Error("isD1BeforeD2 empty value");
|
||||
}
|
||||
//instantiate a luxon date object from val which is assumed to be an iso string
|
||||
const d1Date = window.$gz.DateTime.fromISO(d1);
|
||||
if (!d1Date.isValid) {
|
||||
throw new Error("locale::isD1BeforeD2, d1 not valid:", {
|
||||
d1: d1,
|
||||
d1Date: d1Date
|
||||
});
|
||||
}
|
||||
const d2Date = window.$gz.DateTime.fromISO(d2);
|
||||
if (!d2Date.isValid) {
|
||||
throw new Error("locale::isD1BeforeD2, d2 not valid:", {
|
||||
d2: d2,
|
||||
d2Date: d2Date
|
||||
});
|
||||
}
|
||||
|
||||
return d1Date < d2Date;
|
||||
},
|
||||
|
||||
///////////////////////////////////////////
|
||||
// Turn a decimal number into a local
|
||||
// currency display
|
||||
|
||||
Reference in New Issue
Block a user