Ignore timezone when editing automated tasks
This commit is contained in:
@@ -838,9 +838,9 @@ export default {
|
||||
: [];
|
||||
|
||||
// remove milliseconds and Z to work with native date input
|
||||
task.value.run_time_date = formatDateInputField(task.value.run_time_date);
|
||||
task.value.run_time_date = formatDateInputField(task.value.run_time_date, true);
|
||||
|
||||
if (task.value.expire_date) task.value.expire_date = formatDateInputField(task.value.expire_date);
|
||||
if (task.value.expire_date) task.value.expire_date = formatDateInputField(task.value.expire_date, true);
|
||||
|
||||
// set task type if monthlydow is being used
|
||||
if (task.value.task_type === "monthlydow") {
|
||||
|
||||
@@ -226,7 +226,10 @@ export function getNextAgentUpdateTime() {
|
||||
}
|
||||
|
||||
// converts a date with timezone to local for html native datetime fields -> YYYY-MM-DD HH:mm:ss
|
||||
export function formatDateInputField(isoDateString) {
|
||||
export function formatDateInputField(isoDateString, noTimezone = false) {
|
||||
if (noTimezone) {
|
||||
isoDateString = isoDateString.replace("Z", "")
|
||||
}
|
||||
return date.formatDate(isoDateString, "YYYY-MM-DDTHH:mm:ss")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user