mirror of https://github.com/abpframework/abp
parent
a7e44b739c
commit
b124bb9dee
@ -0,0 +1,17 @@
|
||||
import '../utils/date-extensions';
|
||||
|
||||
describe('DateExtensions', () => {
|
||||
describe('#toLocalISOString', () => {
|
||||
test('should able to use as date prototype', () => {
|
||||
new Date().toLocalISOString();
|
||||
});
|
||||
|
||||
test('should return correct value', () => {
|
||||
const now = new Date();
|
||||
const timezoneOffset = now.getTimezoneOffset();
|
||||
expect(now.toLocalISOString()).toEqual(
|
||||
new Date(now.getTime() - timezoneOffset * 60000).toISOString(),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in new issue