calcms.js: fix last day of month

This commit is contained in:
Milan
2023-02-24 20:12:58 +01:00
parent 89c5e80afa
commit e067bc1448

View File

@@ -123,9 +123,13 @@ var calcms = (function($) {
}
if (field == 'month') {
if (month != '') {
from_date = month;
till_date = month.substring(0, month.length - 2) + "31";
if (month != null && month != '') {
let date = month;
let year = date.substring(0,4);
let mon = date.substring(5,7);
from_date = date;
till_date = date.substring(0, date.length - 2) +
new Date(year, mon , 0).getDate();
}
weekday = '';
date = '';