question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggestions for v2.0

See original GitHub issue

These are ideas for potential breaking changes that could be introduced in v2.0, all open for discussion.

  1. Settings.setDefaultZone instead of Settings.defaultZone setter since input type differs from getter
  2. IANAZone constructor made private, use create() instead to benefit from the cache
  3. Rename Zone.universal to isUniversal
  4. New DateTime.now() method equivalent to local with no parameter
  5. Rename options.setZone to keepZone in DateTime constructors’ options
  6. Add a new DateTime.plus/minus(12, 'hours') method
  7. Deprecate plus/minus(ms), i.e. a number parameter which has no obvious meaning when reading the code
  8. In DateTime, resolvedLocaleOpts, toLocaleString and toLocaleParts all accept an options parameter which is a union of LocaleOptions (i.e. { locale, outputCalendar, numberingSystem } already used in reconfigure and toFormat) and Intl.DateTimeFormatOptions. These could be split into two options parameters instead, each with a different role
  9. DateTime::resolvedLocaleOpts returns an { locale, outputCalendar, numberingSystem } object, whereas Intl.ResolvedDateTimeFormatOptions returns { locale, calendar, numberingSystem (and more) }. outputCalendar could be renamed to calendar instead to be more consistent.
  10. Rename DateTime::resolvedLocaleOpts to resolvedLocaleOptions
  11. DateTime.toSeconds returns an integer value (see #565), so that it can be used in Unix timestamps creation, and can otherwise be replaced by toMillis() / 1000

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
GillesDebunnecommented, Jun 3, 2020

Thoughts:

2 I though this came from the 2.0 branch. I cannot remember why I did it in my branch, although it seems reasonable. I think all I did was to update the tests (24 occurrences) to use create instead of new

5 I agree the name should be more explicit. The impact of an undefined zone is also not obvious. The examples should show the results of these different options

6 Since I believe 90% of the case apply a single unit, this version seems more readable as an English sentence. At least that’s what I wrote first before looking at the documentation.

9 makes sense

11 toUnix feels too specific, and the timestamp precision seems to depend on the file system. What about asSeconds, which indicates a conversion? toSeconds could be deprecated to reduce the footprint.

0reactions
jpike88commented, Jan 7, 2022

I’ve opened a PR to add another function for whole number unix timestamps, it uses the same Math.floor method as Moment.

#1114

Read more comments on GitHub >

github_iconTop Results From Across the Web

Suggestions v2.0 - Superhero Database
Suggestions v2.0. Created by Galactus, 3 y 4 mo 25 d ago. Suggest new features or feature updates for the website. Current Features...
Read more >
Suggestions v2.0 | Fandom - Phantom Forces Wiki
Chauchat (A troll light machine gun, with a slow fire rate of ~240 RPM, but comes with a high damage output of 60-46,...
Read more >
Suggestions Thread for v2.0 - Aurora 4x
Re: Suggestions Thread for v2.0 ... I know that Aurora is heavily leaning toward a strategic/tactical game. But I would love to see...
Read more >
Suggestions and feedback on v2.0 rules, plus some extra tips ...
GeekGold Bonus for All Supporters at year's end: 1000! 16 Days Left. $15 min for supporter badge & GeekGold bonus. Support ...
Read more >
Suggestions for the v2.0 Cog Task... : r/Toontown - Reddit
Add v2.0 Cog Summons as special rewards for defeating the CJ. · Make v2.0 Cogs rarely spawn anywhere from streets to buildings to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found