fix(calculateDurationYmd):moment(endDate).startOf("day").add(1, "days");
Some checks failed
Build & Deploy on Dev / build (push) Has been cancelled
Some checks failed
Build & Deploy on Dev / build (push) Has been cancelled
This commit is contained in:
parent
8e1e5044c7
commit
15fcfe8054
2 changed files with 3 additions and 1 deletions
|
|
@ -374,6 +374,8 @@ function changeStartDate(type: string) {
|
|||
const endDate = new Date(formBody?.endDate);
|
||||
if (startDate > endDate) {
|
||||
formBody.endDate = null;
|
||||
} else {
|
||||
formBody.totalPeriod = calculateDurationYmd(startDate, endDate);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -946,7 +946,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
if (!startDate || !endDate) return "";
|
||||
|
||||
let start = moment(startDate).startOf("day");
|
||||
let end = moment(endDate).startOf("day");
|
||||
let end = moment(endDate).startOf("day").add(1, "days");
|
||||
|
||||
// สลับค่าเพื่อให้ end มากกว่า start เสมอ
|
||||
if (start > end) [start, end] = [end, start];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue