Browse files

Fix datetime values being null when localization is being used. Cause…

…s problems when you try to format dates at execution time
  • Loading branch information...
1 parent 1cf8cc7 commit 68829d2d786bb4cf094dfdc4a4d0d10abf5548ff Colin Campbell committed Jun 8, 2011
Showing with 4 additions and 63 deletions.
  1. +4 −63 frameworks/datetime/frameworks/localized/system/datetime.js
View
67 frameworks/datetime/frameworks/localized/system/datetime.js
@@ -9,54 +9,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
Called on `document.ready`.
@@ -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'));
}
});

0 comments on commit 68829d2

Please sign in to comment.