Skip to content

Commit 3ec030f

Browse files
committed
fix: workaround for minification and classnames check
1 parent 4239811 commit 3ec030f

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

Diff for: src/calendarSystems/CalendarSystemBase.js

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
// "iso8601", "japanese", "persian", "roc", "islamicc".
1515

1616
export default class CalendarSystemBase {
17+
static typeName = 'CalendarSystemBase';
18+
1719
constructor(locale = 'en') {
1820
this.locale = locale;
1921
}

Diff for: src/calendarSystems/GregoryCalendarSystem.js

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import CalendarSystemBase from './CalendarSystemBase';
1313

1414
export default class GregoryCalendarSystem extends CalendarSystemBase {
15-
1615
convertFromGregorian(date) {
1716
// extract year, month, day from date.
1817
// date can be of type Date, Dayjs or object.

Diff for: src/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ export default (options, dayjsClass, dayjsFactory) => {
3939

4040
// Register a new calendar system
4141
dayjsFactory.registerCalendarSystem = (name, calendarSystem) => {
42-
if (!(calendarSystem instanceof CalendarSystemBase)) {
43-
throw new Error('Calendar system must extend CalendarSystemBase');
44-
}
42+
if (calendarSystem.constructor.typeName !== 'CalendarSystemBase') {
43+
throw new Error('Calendar system must extend CalendarSystemBase');
44+
}
4545

4646
calendarSystems[name] = calendarSystem;
4747

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)