mirror of https://github.com/abpframework/abp.git
1 changed files with 17 additions and 0 deletions
@ -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