fix import date cast bug
This commit is contained in:
@ -183,7 +183,7 @@ export default function ImportPage() {
|
|||||||
let day = new Date();
|
let day = new Date();
|
||||||
day.setDate(1); // Set to the first day of the month to avoid overflow
|
day.setDate(1); // Set to the first day of the month to avoid overflow
|
||||||
if (importDate && importDate.value) {
|
if (importDate && importDate.value) {
|
||||||
let monthOfIportInfo = common.getMonthInfo(importDate.value);
|
let monthOfIportInfo = common.getMonthInfo(new Date(importDate.value));
|
||||||
day = monthOfIportInfo.firstMonday;
|
day = monthOfIportInfo.firstMonday;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -249,6 +249,8 @@ exports.getDateFromWeekNrAndDayOfWeek = function (firstMonday, weekNr, dayOfWeek
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.getMonthDatesInfo = function (date) {
|
exports.getMonthDatesInfo = function (date) {
|
||||||
|
// cast to date if not daate
|
||||||
|
date = new Date(date);
|
||||||
// get first day of the month
|
// get first day of the month
|
||||||
var firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
|
var firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
|
||||||
// get first day of next month
|
// get first day of next month
|
||||||
|
Reference in New Issue
Block a user