Revert "added support for treating numbers as date in miliseconds"

This reverts commit 1391f19fb4.
This commit is contained in:
Igor Minar
2010-10-23 18:26:47 -07:00
parent 4fc2141458
commit 4e9a2aa10e
2 changed files with 3 additions and 11 deletions

View File

@@ -75,14 +75,8 @@ var DATE_FORMATS = {
var DATE_FORMATS_SPLIT = /([^yMdHhmsaZ]*)(y+|M+|d+|H+|h+|m+|s+|a|Z)(.*)/;
angularFilter.date = function(date, format) {
var text, fn;
if (!date) return date;
if (!(date instanceof Date)) {
text = parseInt(date, 10);
date = new Date();
date.setTime(text);
}
text = date.toLocaleDateString();
if (!(date instanceof Date)) return date;
var text = date.toLocaleDateString(), fn;
if (format && isString(format)) {
text = '';
var parts = [];

View File

@@ -103,6 +103,7 @@ describe('filter', function(){
it('should ignore falsy inputs', function() {
expect(filter.date(null)).toEqual(null);
expect(filter.date('')).toEqual('');
expect(filter.date(123)).toEqual(123);
});
it('should do basic filter', function() {
@@ -122,9 +123,6 @@ describe('filter', function(){
});
it('should accept miliseconds as date', function(){
expect(filter.date("123", "yyyy")).toEqual('1969');
});
});
});