Additional arithmetics, formatting and parsing functions for std.Datetime.
Open
Nobody has claimed this yet.
✨ enhancement
🎨 sdk
needs-discussion
- Dominant language
- TypeScript
- Stars
- 5.4k
- Forks
- 215
- Avg merge
- 2h 9m
- Merged PRs (30d)
- 27
Description
Use Case
- There is a need to perform simple plus/minus arithmetics between std.DateTime and Duration:
let now = datetime.systemNow();
let expiration = now + duration.fromHours(1);
let validFor = expiration - now;
assert(now <= expiration);
assert(expiration > now);
... - There is a need for additional formatting and parsing functions:
let now = datetime.utcNow();
log(now.toUtcString());
let sd = "2024/06/18 16:15";
let d = datetime.parse(sd, datetime.YYYYMM_HHMM);
assert(d.format(datetime.YYYYMM_HHMM), sd);
Proposed Solution
You may find a sample implementation here: https://github.com/asterkin/endor.w/tree/main/datetimex
Implementation Notes
Some conversions from JavaScript Date to Wing DateTime are performed via ISO string which is inefficient.
Component
SDK
Community Notes
- Please vote by adding a 👍 reaction to the issue to help us prioritize.
- If you are interested to work on this issue, please leave a comment.
- If this issue is labeled needs-discussion, it means the spec has not been finalized yet. Please reach out on the #dev channel in the Wing Discord.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the std.Datetime SDK implementation and compare its API with the linked datetimex sample. Trace the JavaScript Date to Wing DateTime conversions, especially the ISO-string path, before defining the arithmetic, formatting, and parsing behavior. Done means the proposed DateTime and Duration operations and formatting/parsing functions work as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100