-
Notifications
You must be signed in to change notification settings - Fork 57
Relationship between BigInt and Date #136
Comments
Is there any reason not to allow a BigInt as well as a Number in Date? |
Date's data model is already fundamentally broken. I don't see the point of complicating it with BigInt; precision is sort of the least of Date's problems. I like @maggiepint's approach of a new set of classes to resolve this issue instead. |
I certainly want the Temporal proposal; but I'm not sure making BigInt unergonomic when combined with existing builtins is appropriate. |
The BigInt design is predicated on it being OK to be unergonomic in existing libraries and interfaces. We decided it's better to ask programmers to explicitly request the precision loss with a call to |
There is a starting-point polyfill for Temporal now, and it uses BigInt. If you'd like to take a peek, please submit feedback there https://github.com/tc39/proposal-temporal/pull/57/files#diff-4c66be3ac0c3f5b83e963105c61aa60bR39 |
OK, we'll continue pursuing this effort in the context of the temporal proposal. Thanks everyone! Closing this issue to discuss over there. |
I was working on a prototype of BigInt support for
fs.Stat
in Node.js and I noticed that there are no way to construct a Date out of ms in BigInt. In a conversation with @littledan I learned that it's because Date is Number-based, a better solution for date time with BigInt support would be the Temporal proposal. It would be good if there is explanation in the README about this.The text was updated successfully, but these errors were encountered: