diff --git a/packages/base/src/dates/CalendarDate.js b/packages/base/src/dates/CalendarDate.js index 10655ae9d5ca..8aa4b2efb0ab 100644 --- a/packages/base/src/dates/CalendarDate.js +++ b/packages/base/src/dates/CalendarDate.js @@ -149,7 +149,7 @@ class CalendarDate { function isValidDate(date) { return date && Object.prototype.toString.call(date) === "[object Date]" && !isNaN(date); // eslint-disable-line } - if (!isValidDate()) { + if (!isValidDate(oJSDate)) { throw new Error(`Date parameter must be a JavaScript Date object: [${oJSDate}].`); } return new CalendarDate(oJSDate.getFullYear(), oJSDate.getMonth(), oJSDate.getDate(), sCalendarType); diff --git a/packages/main/src/DayPicker.js b/packages/main/src/DayPicker.js index d2932f9bd7a4..0e7ed03c9987 100644 --- a/packages/main/src/DayPicker.js +++ b/packages/main/src/DayPicker.js @@ -174,9 +174,7 @@ class DayPicker extends UI5Element { lastWeekNumber = weekNumber; } - const isToday = (oCalDate.getDate() === this._currentCalendarDate.getDate()) - && (oCalDate.getMonth() === this._currentCalendarDate.getMonth()) - && (oCalDate.getYear() === this._currentCalendarDate.getYear()); + const isToday = oCalDate.isSame(CalendarDate.fromLocalJSDate(new Date(), this._primaryCalendarType)); week.push(day); diff --git a/packages/main/test/pages/i18n-demo.html b/packages/main/test/pages/i18n-demo.html new file mode 100644 index 000000000000..d2e87c704bde --- /dev/null +++ b/packages/main/test/pages/i18n-demo.html @@ -0,0 +1,56 @@ + + + + + + + + i18n Demo + + + + + + + + + + + + + + +
+ + + +
+
+ + + + +
+
+ + + +
+
+ + Martin's cheat sheet + +
+ maƱana, ayer +
+ + + \ No newline at end of file