Skip to content

Suggestions for v2.0 #717

@GillesDebunne

Description

@GillesDebunne

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 DateTime.toSeconds returns seconds.milliseconds #565), so that it can be used in Unix timestamps creation, and can otherwise be replaced by toMillis() / 1000

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions