diff options
| author | Igor Minar | 2011-08-12 02:28:45 -0700 | 
|---|---|---|
| committer | Igor Minar | 2011-08-14 23:44:21 -0700 | 
| commit | 37b5c5cfe9df70fa2a2c6c681a903b7c356aec74 (patch) | |
| tree | 53a01012cd69c194d40325613313450a1285d494 /src/filters.js | |
| parent | 966cbd4cf8d795b1706ff400f604c6002d7e81f9 (diff) | |
| download | angular.js-37b5c5cfe9df70fa2a2c6c681a903b7c356aec74.tar.bz2 | |
break(date): remove support for 'long', 'longtime' date formats and 'z' flag
The support for the 'z' formatting flag was removed becase the timezone
info can't be retrieved from the browser apis (except for en-US locale
on some but not all browsers). For this reason we don't want to support
this flag at all.
Related to this, since the 'long' and 'longtime' datetime formats require
the 'z' flag in the formatting string, we are removing support for this
format as well.
Diffstat (limited to 'src/filters.js')
| -rw-r--r-- | src/filters.js | 21 | 
1 files changed, 5 insertions, 16 deletions
| diff --git a/src/filters.js b/src/filters.js index b3d4c437..f636b242 100644 --- a/src/filters.js +++ b/src/filters.js @@ -215,16 +215,10 @@ function dateStrGetter(name, shortForm) {    };  } -function timeZoneGetter(numFormat) { -  return function(date) { -    var timeZone; -    if (numFormat || !(timeZone = GET_TIME_ZONE.exec(date.toString()))) { -      var offset = date.getTimezoneOffset(); -      return padNumber(offset / 60, 2) + padNumber(Math.abs(offset % 60), 2); -    } -    return timeZone[0]; -  }; -} +function timeZoneGetter(date) { +  var offset = date.getTimezoneOffset(); +  return padNumber(offset / 60, 2) + padNumber(Math.abs(offset % 60), 2); +};  function ampmGetter(date, formats) {    return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1]; @@ -251,8 +245,7 @@ var DATE_FORMATS = {    EEEE: dateStrGetter('Day'),     EEE: dateStrGetter('Day', true),       a: ampmGetter, -     z: timeZoneGetter(false), -     Z: timeZoneGetter(true) +     Z: timeZoneGetter  };  var GET_TIME_ZONE = /[A-Z]{3}(?![+\-])/; @@ -293,13 +286,10 @@ var NUMBER_STRING = /^\d+$/;   *   * `'s'`: Second in minute (0-59)   *   * `'a'`: am/pm marker   *   * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-1200) - *   * `'z'`: short form of current timezone name (e.g. PDT)   *   *   `format` string can also be one of the following predefined   *   {@link guide/dev_guide.i18n localizable formats}:   * - *   * `'long'`: equivalent to `'MMMM d, y h:mm:ss a z'` for en_US  locale - *     (e.g. September 3, 2010 12:05:08 pm PDT)   *   * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale   *     (e.g. Sep 3, 2010 12:05:08 pm)   *   * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US  locale (e.g. 9/3/10 12:05 pm) @@ -308,7 +298,6 @@ var NUMBER_STRING = /^\d+$/;   *   * `'longDate'`: equivalent to `'MMMM d, y'` for en_US  locale (e.g. September 3, 2010   *   * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US  locale (e.g. Sep 3, 2010)   *   * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10) - *   * `'longTime'`: equivalent to `'h:mm:ss a z'` for en_US locale (e.g. 12:05:08 pm PDT)   *   * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 pm)   *   * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 pm)   * | 
