0.2.6 • Published 10 months ago

@gallolabs/nanodate v0.2.6

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

A javascript date with nano precision

import NanoDate from '@gallolabs/nanodate'
const nanodate = new NanoDate()

console.log(nanodate.toJSON())
// 2024-10-25T22:46:17.894315765Z

console.log(nanodate.getTime())
// 1729898417176787742n

const nanodate = new NanoDate('2024-10-25T22:46:17.894315765+02:00')

console.log(nanodate.toJSON())
// 2024-10-25T20:46:17.894315765Z

nanodate.setYear(2023)
NanoDate.now()
// ... Date compatible excepts get/setMilliseconds migrated to get/setNanoseconds

Warning : Currently NanoDate extends Date. But there are some interface incompatibilies and as the returned values are not the same (and not always the same type), this can broke Date consumers. I think I will stop to extend Date and implement all the Date methods to keep NanoDate as Date for humans but not as instanceof Date.

0.2.6

10 months ago

0.2.5

10 months ago

0.2.4

10 months ago

0.2.3

10 months ago

0.2.2

10 months ago

0.2.1

10 months ago

0.2.0

10 months ago