jalali-moment
Advanced tools
Comparing version 3.2.4 to 3.2.5
@@ -5,2 +5,3 @@ | ||
var moment = require("moment"); | ||
require("moment/locale/fa"); | ||
@@ -1307,2 +1308,2 @@ /************************************ | ||
}; | ||
} | ||
} |
{ | ||
"name": "jalali-moment", | ||
"version": "3.2.4", | ||
"version": "3.2.5", | ||
"description": "Manipulate and convert Jalali and Gregorian date easily", | ||
@@ -5,0 +5,0 @@ "author": { |
49
test.js
@@ -1080,2 +1080,51 @@ | ||
}); | ||
describe("getting week fa locale", function () { | ||
moment.locale("en"); | ||
var now = moment(); | ||
now.locale("fa"); | ||
it("week with fa locale", function () { | ||
now.week().should.be.equal(now.jWeek()); | ||
}); | ||
it("week year with fa locale", function () { | ||
now.weekYear().should.be.equal(now.jWeekYear()); | ||
}); | ||
}); | ||
describe("getting from now with fa locale", function () { | ||
moment.locale("fa"); | ||
it("just now", function () { | ||
var now = moment(); | ||
now.locale("fa"); | ||
now.fromNow().should.be.equal("چند ثانیه پیش"); | ||
}); | ||
it("10 seconds ago", function () { | ||
var now = moment(); | ||
now.locale("fa"); | ||
now.subtract(10, "s"); | ||
now.fromNow().should.be.equal("چند ثانیه پیش"); | ||
}); | ||
it("100 seconds ago", function () { | ||
var now = moment(); | ||
now.locale("fa"); | ||
now.subtract(100, "s"); | ||
now.fromNow().should.be.equal("2 دقیقه پیش"); | ||
}); | ||
it("5 days ago", function () { | ||
var now = moment(); | ||
now.locale("fa"); | ||
now.subtract(5, "d"); | ||
now.fromNow().should.be.equal("5 روز پیش"); | ||
}); | ||
it("1 month ago", function () { | ||
var now = moment(); | ||
now.locale("fa"); | ||
now.subtract(1, "months"); | ||
now.fromNow().should.be.equal("1 ماه پیش"); | ||
}); | ||
it("3 years ago", function () { | ||
var now = moment(); | ||
now.locale("fa"); | ||
now.subtract(3, "year"); | ||
now.fromNow().should.be.equal("3 سال پیش"); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1271037
15
4009