Hi,
After SGWT LGPL upgrade from v13.0d_2021-04-05 to v13.0d_2021-07-16 I have got this exception:
in CalendarView.js getInnerFieldTitle() function:
format variable value in my case is:
Here is diff comparing to working (2021-04-05) version.
Could you have a look?
MichalG
After SGWT LGPL upgrade from v13.0d_2021-04-05 to v13.0d_2021-07-16 I have got this exception:
Code:
Uncaught TypeError: format.replace is not a function
Code:
getInnerFieldTitle : function (headerLevel, spanIndex, startDate, endDate) { var granularity = headerLevel.unit, result = headerLevel.titles ? headerLevel.titles[spanIndex] : null ; if (!result) { // only generate a default value and call the titleFormatter if there was no // entry for this particular span in headerLevels.titles if (granularity == "year") { result = startDate.getFullYear(); } else if (granularity == "month") { result = startDate.getShortMonthName(); } else if (granularity == "week") { // use the week number for the Date.firstWeekIncludesDay'th day of the week - thursday var midWeek = isc.DateUtil.getStartOf(startDate, "W", null, this.calendar.firstDayOfWeek); midWeek.setDate(midWeek.getDate() + (midWeek.firstWeekIncludesDay - this.calendar.firstDayOfWeek)); result = this.calendar.weekPrefix + " " + midWeek.getWeek(this.calendar.firstDayOfWeek); } else if (granularity == "day") { // get the order of date parts from the inputFormat and use the defaultDateSeparator var format = isc.Date.getInputFormat(); // remove year and transform day format = format.replace("Y", ""); //<--Uncaught TypeError: format.replace is not a function format = format.replace("D", "d"); format = format[0] + isc.Date.getDefaultDateSeparator() + format[1]; result = isc.DateUtil.format(startDate, format); } else { var mins = startDate.getMinutes().toString(); if (mins.length == 1) mins = "0" + mins; result = startDate.getHours() + ":" + mins; } if (isc.isA.Function(headerLevel.titleFormatter)) { result = headerLevel.titleFormatter(headerLevel, startDate, endDate, result, this.calendar); } } return result; },
Code:
(anonymous) DateUtil.java:1495 ƒ anonymous(dateStr_0_g$)
Code:
result = startDate.getShortMonthName(); } else if (granularity == "week") { // use the week number for the Date.firstWeekIncludesDay'th day of the week - thursday - var midWeek = isc.DateUtil.getStartOf(startDate.duplicate(), "W", null, this.calendar.firstDayOfWeek); + var midWeek = isc.DateUtil.getStartOf(startDate, "W", null, this.calendar.firstDayOfWeek); midWeek.setDate(midWeek.getDate() + (midWeek.firstWeekIncludesDay - this.calendar.firstDayOfWeek)); result = this.calendar.weekPrefix + " " + midWeek.getWeek(this.calendar.firstDayOfWeek); } else if (granularity == "day") { - result = (startDate.getMonth() + 1) + "/" + startDate.getDate(); + // get the order of date parts from the inputFormat and use the defaultDateSeparator + var format = isc.Date.getInputFormat(); + // remove year and transform day + format = format.replace("Y", ""); + format = format.replace("D", "d"); + format = format[0] + isc.Date.getDefaultDateSeparator() + format[1]; + result = isc.DateUtil.format(startDate, format); } else { var mins = startDate.getMinutes().toString(); if (mins.length == 1) mins = "0" + mins;
MichalG
Comment