Open kitce opened 4 months ago
Is your feature request related to a problem? Please describe. I want Sunday to be the first day of the week for "Day" view, instead of Monday
Describe the solution you'd like
gantt.setOptions({ vFirstDayOfWeek: 0, // 0-6: Sunday to Saturday // or vFirstDayOfWeek: 'Sunday' // "Sunday" | "Monday" })
Describe alternatives you've considered I have tried to patch the code in date_utils.js
date_utils.js
exports.getMinDate = function (pList, pFormat, pMinDate) { ... if (pFormat == 'day') { vDate.setDate(vDate.getDate() - 1); - while (vDate.getDay() % 7 != 1) + while (vDate.getDay() % 7 != 0) vDate.setDate(vDate.getDate() - 1); } ... } exports.getMaxDate = function (pList, pFormat, pMaxDate) { ... if (pFormat == 'day') { vDate.setDate(vDate.getDate() + 1); - while (vDate.getDay() % 7 != 0) + while (vDate.getDay() % 7 != 6) vDate.setDate(vDate.getDate() + 1); } ... }
It seems to work as expected, but I am not sure about the edge cases. and I prefer not to patch the package
Is your feature request related to a problem? Please describe. I want Sunday to be the first day of the week for "Day" view, instead of Monday
Describe the solution you'd like
Describe alternatives you've considered I have tried to patch the code in
date_utils.js
It seems to work as expected, but I am not sure about the edge cases. and I prefer not to patch the package