heb-dates-helper
Version:
Functions that help display dates in Hebrew
17 lines (16 loc) • 1.04 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
var index_1 = require("../index");
test('HelperFunctions', function () {
expect(index_1.dateToNumeric('12/20/2020')).toBe('20/12/2020');
expect(index_1.dateToVerbal('12/20/2020')).toBe('יום ראשון, 20 בדצמבר 2020');
expect(index_1.dateToNumeric(new Date('12/20/2020'))).toBe('20/12/2020');
expect(index_1.dateToVerbal(new Date('12/20/2020'))).toBe('יום ראשון, 20 בדצמבר 2020');
expect(index_1.heToDate('20/12/2020')).toStrictEqual(new Date(2020, 11, 20));
expect(index_1.heToEn('20/12/2020')).toBe('12/20/2020');
expect(index_1.heDateToVerbal('20/12/2020')).toBe('יום ראשון, 20 בדצמבר 2020');
expect(index_1.getDiffBetweenDates(new Date('12/22/2020'), new Date('12/20/2020'))).toBe(2);
expect(index_1.getDiffBetweenDates('12/22/2020', '12/20/2020')).toBe(2);
expect(index_1.hasDatePassed('12/22/2030')).toBe(false);
expect(index_1.hasDatePassed('12/22/2018')).toBe(true);
});
;