Commit graph

26 commits

Author SHA1 Message Date
Misko Hevery
fd822bdaf9 chore(formating): clean code to be function() { 2011-10-11 11:01:46 -07:00
Vojta Jina
fc2f188d4d style(filter): Couple of missing spaces, semi-colons, add empty lines 2011-09-08 17:59:52 +02:00
Vojta Jina
4b1913c5ec fix(filter.currency): Return empty string for non-numbers 2011-09-08 17:59:45 +02:00
Igor Minar
37b5c5cfe9 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.
2011-08-14 23:44:21 -07:00
Di Peng
8534b7c7c0 refactor(date,curreny,number): inject and use $locale in filters
- filter.number, filter.currency and filter.date are injected with
$locale service so that we can just swap the service to localize these
- date filter was beefed up in order to support literal strings found in
  localization rules
2011-08-14 23:44:20 -07:00
Di Peng
31b59efa96 feat(number/currency filter): format numbers and currency using pattern
both numbers and currency need to be formatted using a generic pattern
which can be replaced for a different pattern when angular is working in
a non en-US locale

for now only en-US locale is supported, but that will change in the
future
2011-07-26 14:16:57 -07:00
Di Peng
3af1e7ca2e feat(filter.date): add support for default datetime formats in en
- add support for full,long, medium, short datetime formats in en

Breaks MMMMM. now we don't support MMMMM anymore as old implementation differs
from Unicode Locale Data format we are following.

- removed support for fullDateTime and fullTime as it means too much
trouble with full timeZone names
- added docs for the new features
2011-07-20 17:06:56 -07:00
Igor Minar
fe5240732d feat(strict mode): adding strict mode flag to all js files
the flag must be in all src and test files so that we get the benefit of
running in the strict mode even in jstd

the following script was used to modify all files:

for file in `find src test -name "*.js"`; do
  echo -e "'use strict';\n" > temp.txt
  cat $file >> temp.txt
  mv temp.txt $file
done
2011-07-18 12:12:55 -07:00
Di Peng
b5a510a343 feat:filter.date: add day/month string format support
Support new date format, specifically day of week/Month of year in string
e.g. {{ someDate | data:"EEE, MMM d, yyyy" }} -> "Wed, Jul 10, 2011"

Closes #396
2011-06-23 12:06:46 -07:00
Misko Hevery
d6eba8f39f Number filter would return incorrect value when fractional part had leading zeros. 2011-06-08 13:49:09 -07:00
Misko Hevery
c2f2587a79 fixed example rendering, add tests for it. 2011-01-24 14:23:51 -08:00
Vojta Jina
aab3df7aea Fixed filter.date, so it parses format ending with non-replaced string
Closes #159
2011-01-10 10:37:37 -08:00
Vojta Jina
d458f31711 Updated filters tests to use jasmine expects
And some small formatting...
2010-11-09 07:38:03 -08:00
Igor Minar
e5c135ac50 Support ISO 8601 extended datetime format troughout angular.
Support ISO 8601 extended format datetime strings (YYYY-MM-DDTHH:mm:ss.SSSZ) as defined
  in EcmaScript 5 throughout angular. This means that the following apis switched from
  YYYY-MM-DDTHH:mm:ssZ to YYYY-MM-DDTHH:mm:ss.SSSZ (note the added millis) when representing dates:
  - angular.Date.toString
  - angular.String.toDate
  - JSON serialization and deserialization (used by json filter, $xhr and $resource)
2010-11-08 22:49:30 -08:00
Igor Minar
1c305dc67a fixing spec description for the date filter 2010-11-08 22:46:41 -08:00
Igor Minar
a397645537 date filter should accept ISO 8601 formatted string as input
Closes #125
2010-11-08 22:46:41 -08:00
Misko Hevery
5159eb7635 fix the linky filter 2010-11-03 09:47:22 -07:00
Igor Minar
4c61fc01f9 Add TzDate to angular-mocks.js
TzDate is a Date-like type that is independent from the timezone
settings of the machine on which TzDate instances are created.
This property makes it ideal for testing code that deals with
timezones in a manner that makes the code portable between timezones.

Closes #81
2010-10-26 13:47:50 -07:00
Igor Minar
841013a4c4 Add millisecond support for date filter
Date filter should translate input which is a number (or number
string) into a date.
2010-10-25 10:44:03 -07:00
Igor Minar
4e9a2aa10e Revert "added support for treating numbers as date in miliseconds"
This reverts commit 1391f19fb4.
2010-10-23 18:26:47 -07:00
Misko Hevery
1391f19fb4 added support for treating numbers as date in miliseconds 2010-10-23 14:38:08 -07:00
Misko Hevery
c5cfe2b393 fix date filter to igrone falsy input 2010-10-19 20:38:49 -07:00
Igor Minar
4bef371e5a fixing css class name for currency filter and its spec 2010-10-18 16:24:43 -07:00
Misko Hevery
b96f736951 fixed date formater and make it work on ie 2010-10-16 21:43:28 -07:00
Vojta Jina
312f93574e Fixed filter date test - remove dependency on machine timezone
It would be better to separate the time-zone logic to a separate unit and test just this logic.
This logic is simply convert minutes to HH:MM, the source of time-zone is from date object...
2010-10-16 21:29:30 -07:00
Misko Hevery
0f104317df Added support for date filter
Date filter now supports:
yyyy: four digit year
  yy: two digit year
  MM: two digit month
  dd: two digit day of month
  HH: two digit hour in 0-23
  KK: two digit hour in 0-12
  mm: two digit minute
  ss: two digit second
   a: am/pm
   Z: four digit timezone offset

example {{ timestamp | date:'yyyy-MM-dd HH:mm:ss' }} becomes 2010-10-13 14:45:23
2010-10-13 23:15:40 -07:00