Skip to content

Commit

Permalink
Fix datetime values being null when localization is being used. Cause…
Browse files Browse the repository at this point in the history
…s problems when you try to format dates at execution time
  • Loading branch information
Colin Campbell committed Jun 8, 2011
1 parent 1cf8cc7 commit 68829d2
Showing 1 changed file with 4 additions and 63 deletions.
67 changes: 4 additions & 63 deletions frameworks/datetime/frameworks/localized/system/datetime.js
Expand Up @@ -8,54 +8,6 @@
SC.DateTime.mixin(
/** @scope SC.DateTime */ {

/**
The localized day names. Add the key `_SC.DateTime.dayNames` and its
value to your `strings.js` file to add support for another language than
English.
Default is evaluated on the `document.ready` event.
@type Array
@default '_SC.DateTime.dayNames'.loc().w()
*/
dayNames: null,

/**
The localized abbreviated day names. Add the key
`_SC.DateTime.abbreviatedDayNames` and its value to your `strings.js`
file to add support for another language than English.
Default is evaluated on the `document.ready` event.
@type Array
@default '_SC.DateTime.abbreviatedDayNames'.loc().w()
*/
abbreviatedDayNames: null,

/**
The localized month names. Add the key `_SC.DateTime.monthNames` and its
value to your `strings.js` file to add support for another language than
English.
Default is evaluated on the `document.ready` event.
@type Array
@default '_SC.DateTime.monthNames'.loc().w()
*/
monthNames: null,

/**
The localized abbreviated month names. Add the key
`_SC.DateTime.abbreviatedMonthNames` and its value to your `strings.js`
file to add support for another language than English.
Default is evaluated on the `document.ready` event.
@type Array
@default '_SC.DateTime.abbreviatedMonthNames'.loc().w()
*/
abbreviatedMonthNames: null,

/**
@private
Expand All @@ -65,21 +17,10 @@ SC.DateTime.mixin(
we need to wait for the ready event to actually evaluate the localizations.
*/
_setup: function() {
if (!SC.DateTime.dayNames) {
SC.DateTime.dayNames = SC.String.w(SC.String.loc('_SC.DateTime.dayNames'));
}

if (!SC.DateTime.abbreviatedDayNames) {
SC.DateTime.abbreviatedDayNames = SC.String.w(SC.String.loc('_SC.DateTime.abbreviatedDayNames'));
}

if (!SC.DateTime.monthNames) {
SC.DateTime.monthNames = SC.String.w(SC.String.loc('_SC.DateTime.monthNames'));
}

if (!SC.DateTime.abbreviatedMonthNames) {
SC.DateTime.abbreviatedMonthNames = SC.String.w(SC.String.loc('_SC.DateTime.abbreviatedMonthNames'));
}
SC.DateTime.dayNames = SC.String.w(SC.String.loc('_SC.DateTime.dayNames'));
SC.DateTime.abbreviatedDayNames = SC.String.w(SC.String.loc('_SC.DateTime.abbreviatedDayNames'));
SC.DateTime.monthNames = SC.String.w(SC.String.loc('_SC.DateTime.monthNames'));
SC.DateTime.abbreviatedMonthNames = SC.String.w(SC.String.loc('_SC.DateTime.abbreviatedMonthNames'));
}

});
Expand Down

0 comments on commit 68829d2

Please sign in to comment.