Просмотр исходного кода

fix dayNumber in month view not respecing locale. fixes #3339

Adam Shaw 8 лет назад
Родитель
Сommit
37e5e48e69
2 измененных файлов с 16 добавлено и 1 удалено
  1. 1 1
      src/basic/DayGrid.ts
  2. 15 0
      tests/date-render/dayNumbers.js

+ 1 - 1
src/basic/DayGrid.ts

@@ -268,7 +268,7 @@ export default class DayGrid extends InteractiveDateComponent {
       html += view.buildGotoAnchorHtml(
         date,
         { 'class': 'fc-day-number' },
-        date.date() // inner HTML
+        date.format('D') // inner HTML
       )
     }
 

+ 15 - 0
tests/date-render/dayNumbers.js

@@ -0,0 +1,15 @@
+
+describe('dayNumbers', function() {
+  pushOptions({
+    defaultDate: '2018-01-01'
+  })
+
+  it('respects locale in month view', function() {
+    initCalendar({
+      defaultView: 'month',
+      locale: 'ar'
+    })
+    expect($('td[data-date="2018-01-01"]')).toContainText('١') // an Arabic 1
+  })
+
+})