mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 14:00:39 -07:00
global locale test for date filter
This commit is contained in:
+3
-3
@@ -5,7 +5,6 @@ var liquid = require('..')();
|
|||||||
|
|
||||||
describe('filters', function() {
|
describe('filters', function() {
|
||||||
var ctx = {
|
var ctx = {
|
||||||
date: new Date('1995-12-17T03:24:00'),
|
|
||||||
foo: 'bar',
|
foo: 'bar',
|
||||||
arr: [-2, 'a']
|
arr: [-2, 'a']
|
||||||
};
|
};
|
||||||
@@ -32,8 +31,9 @@ describe('filters', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should support date', function() {
|
it('should support date', function() {
|
||||||
expect(liquid.render('{{ date | date:"%Y-%m-%d %H:%M:%S"}}', ctx)).to.equal('1995-12-17 11:24:00');
|
var d = ctx.date = new Date();
|
||||||
expect(liquid.render('{{ date | date:"%a, %b %d, %y"}}', ctx)).to.equal('Sun, Dec 17, 95');
|
str = d.toDateString();
|
||||||
|
expect(liquid.render('{{ date | date:"%a %b %d %Y"}}', ctx)).to.equal(str);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should support default', function() {
|
it('should support default', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user