This commit is contained in:
@@ -322,7 +322,7 @@ export default {
|
||||
// and return time portion only in iso 8601
|
||||
// format (used by time and date picker components)
|
||||
//
|
||||
utcDateStringTo8601TimeOnlyString(value, timeZoneName) {
|
||||
utcDateStringToLocal8601TimeOnlyString(value, timeZoneName) {
|
||||
if (!value) {
|
||||
//if no value, return the current time as expected by the time picker
|
||||
} else {
|
||||
@@ -355,6 +355,27 @@ export default {
|
||||
.setZone("utc") //convert to UTC
|
||||
.toISO(); //output as ISO 8601
|
||||
},
|
||||
///////////////////////////////////////////////
|
||||
// Convert a utc date to local time zone
|
||||
// and return date only portion only in iso 8601
|
||||
// format (used by time and date picker components)
|
||||
//
|
||||
utcDateStringToLocal8601DateOnlyString(value, timeZoneName) {
|
||||
if (!value) {
|
||||
//if no value, return the current time as expected by the time picker
|
||||
} else {
|
||||
//ok, the reason for sv-SE is that it's a locale that returns the time already in ISO format and 24hr by default
|
||||
//that can change over time so if this breaks that's why
|
||||
//also fr-CA does as well as possibly en-CA
|
||||
//https://stackoverflow.com/a/58633686/8939
|
||||
if (!timeZoneName) {
|
||||
timeZoneName = this.getTimeZoneName();
|
||||
}
|
||||
return new Date(value).toLocaleDateString("sv-SE", {
|
||||
timeZone: timeZoneName
|
||||
});
|
||||
}
|
||||
},
|
||||
////////////////////////////////////////////////////////
|
||||
// dynamically set the vuetify language elements from
|
||||
// users localized text (am/pm etc)
|
||||
|
||||
Reference in New Issue
Block a user