fix Time call
This commit is contained in:
@@ -276,7 +276,7 @@ const isTodayReminder = computed(() => {
|
||||
if (!remindAt) {
|
||||
return false;
|
||||
}
|
||||
return Time.formatDate(new Date(remindAt)) === Time.formatDate(new Date(Time.now()));
|
||||
return Time.toDate(new Date(remindAt)) === Time.toDate(new Date(Time.now()));
|
||||
});
|
||||
const isBeforeSmsCutoff = computed(() => {
|
||||
const now = new Date(Time.now());
|
||||
@@ -378,20 +378,20 @@ const minimumDateTimeText = computed(() => {
|
||||
const date = new Date(Time.now());
|
||||
date.setSeconds(0, 0);
|
||||
date.setMinutes(date.getMinutes() + 1);
|
||||
return Time.formatDateTime(date);
|
||||
return Time.toDateTime(date);
|
||||
});
|
||||
|
||||
function getQuickRemindAt(dayOffset: number): string {
|
||||
const date = new Date(Time.now());
|
||||
date.setSeconds(0, 0);
|
||||
date.setDate(date.getDate() + dayOffset);
|
||||
return Time.formatDateTime(date);
|
||||
return Time.toDateTime(date);
|
||||
}
|
||||
|
||||
function getQuickRemindDate(dayOffset: number): string {
|
||||
const date = new Date(Time.now());
|
||||
date.setDate(date.getDate() + dayOffset);
|
||||
return Time.formatDate(date);
|
||||
return Time.toDate(date);
|
||||
}
|
||||
|
||||
function getRemindAtPreset(value: string): RemindAtPreset {
|
||||
@@ -399,7 +399,7 @@ function getRemindAtPreset(value: string): RemindAtPreset {
|
||||
if (!remindAt) {
|
||||
return "tomorrow";
|
||||
}
|
||||
const remindDate = Time.formatDate(new Date(remindAt));
|
||||
const remindDate = Time.toDate(new Date(remindAt));
|
||||
if (remindDate === getQuickRemindDate(1)) {
|
||||
return "tomorrow";
|
||||
}
|
||||
@@ -564,7 +564,7 @@ function applyReminder(current: FollowUpReminder): void {
|
||||
customerId: current.customerId || "",
|
||||
responsibleUserId: current.responsibleUserId || "",
|
||||
content: current.content || "",
|
||||
remindAtText: current.remindAt ? Time.formatDateTime(new Date(current.remindAt)) : minimumDateTimeText.value,
|
||||
remindAtText: current.remindAt ? Time.toDateTime(new Date(current.remindAt)) : minimumDateTimeText.value,
|
||||
notifyChannelList: current.notifyChannelList || buildChannelList(current)
|
||||
});
|
||||
selectedCustomer.value = current.customer;
|
||||
|
||||
Reference in New Issue
Block a user