Permalink
Browse files

Update shortWeekday locales for estonian, english and australian and …

…make calendar to use that instead of subtracting 2 letters from long weekday name
  • Loading branch information...
theghostbel authored and eeroan committed Mar 12, 2013
1 parent 58c2ce7 commit 1bcfb127939ed9cf4ecc90b3080c18460182dc88
Showing with 8 additions and 8 deletions.
  1. +1 −1 src/main/CalendarBody.js
  2. +3 −3 src/main/DateLocale.js
  3. +4 −4 src/test/jquery.continuousCalendar.spec.js
View
@@ -44,7 +44,7 @@
var tr = $('<tr><th class="month"></th><th class="week">&nbsp;</th>')
$(locale.dayNames).each(function(index) {
//TODO move to DateLocale
- var weekDay = $('<th>').append(locale.dayNames[(index + locale.firstWeekday) % 7].substr(0, 2)).addClass('weekDay')
+ var weekDay = $('<th>').append(locale.shortDayNames[(index + locale.firstWeekday) % 7]).addClass('weekDay')
tr.append(weekDay)
})
return $('<thead>').append(tr)
View
@@ -28,7 +28,7 @@
id : 'EN',
monthNames : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
dayNames : ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
- shortDayNames : ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
+ shortDayNames : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
yearsLabel : function(years) { return years + ' ' + (years == '1' ? 'Year' : 'Years'); },
monthsLabel : function(months) { return months + ' ' + (months == '1' ? 'Months' : 'Months') },
daysLabel : function(days) { return days + ' ' + (days == '1' ? 'Day' : 'Days') },
@@ -45,7 +45,7 @@
id : 'AU',
monthNames : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
dayNames : ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
- shortDayNames : ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
+ shortDayNames : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
yearsLabel : function(years) { return years + ' ' + (years == '1' ? 'Year' : 'Years'); },
monthsLabel : function(months) { return months + ' ' + (months == '1' ? 'Months' : 'Months') },
daysLabel : function(days) { return days + ' ' + (days == '1' ? 'Day' : 'Days') },
@@ -62,7 +62,7 @@
id : 'ET',
monthNames : [ 'Jaanuar', 'Veebruar', 'Märts', 'Aprill', 'Mai', 'Juuni', 'Juuli', 'August', 'September', 'Oktoober', 'November', 'Detsember'],
dayNames : ['Pühapäev', 'Esmaspäev', 'Teisipäev', 'Kolmapäev', 'Neljapäev', 'Reede', 'Laupäev'],
- shortDayNames : ['', 'Es', 'Te', 'Ko', 'Ne', 'Re', 'La'],
+ shortDayNames : ['P', 'E', 'T', 'K', 'N', 'R', 'L'],
yearsLabel : function(years) { return years + ' ' + (years == '1' ? 'Aasta' : 'Aastat') },
monthsLabel : function(months) { return months + ' ' + (months == '1' ? 'Kuu' : 'Kuud') },
daysLabel : function(days) { return days + ' ' + (days == '1' ? 'Päev' : 'Päeva') },
@@ -155,7 +155,7 @@ define(function(require) {
cal().find('.date:eq(1)').click()
expect(cal().find('.selected')).toHaveText('28')
expect(startFieldValue()).toEqual('4/28/2008')
- expect(startLabelValue()).toEqual('Mon 4/28/2008')
+ expect(startLabelValue()).toEqual('Mo 4/28/2008')
})
it('week number click selects whole week', function() {
@@ -264,7 +264,7 @@ define(function(require) {
dragDates(28, 29)
assertHasValues('.selected', [27, 28, 29, 30, 1, 2, 3])
expect(startFieldValue()).toEqual('4/27/2009')
- expect(startLabelValue()).toEqual('Mon 4/27/2009')
+ expect(startLabelValue()).toEqual('Mo 4/27/2009')
expect(endFieldValue()).toEqual('5/3/2009')
})
@@ -388,7 +388,7 @@ define(function(require) {
it('', function() {
createPopupCalendar()
expect(cal().find('.continuousCalendar')).not.toBeVisible()
- expect(startLabelValue()).toEqual('Wed 4/29/2009', 'Initially selected date is shown correctly')
+ expect(startLabelValue()).toEqual('We 4/29/2009', 'Initially selected date is shown correctly')
cal().find('.calendarIcon').click()
expect(cal().find('.continuousCalendar')).toBeVisible()
//TODO fix this
@@ -402,7 +402,7 @@ define(function(require) {
cal().find('.date:first').click()
expect(cal().find('.continuousCalendar')).not.toBeVisible()
expect(previous.find('.continuousCalendar')).toBeVisible()
- expect(startLabelValue()).toEqual('Sun 10/26/2008')
+ expect(startLabelValue()).toEqual('Su 10/26/2008')
expect(startFieldValue()).toEqual('10/26/2008')
})
})

0 comments on commit 1bcfb12

Please sign in to comment.