Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce an UTC mode simpler than #168 #326

Closed
wants to merge 3 commits into from

Commits on Sep 9, 2018

  1. Introduce an UTC mode

    Additions:
    
    * Constructor accepts a boolean flag to enable the UTC mode: { utc: true }.
    * Method utc() returns a clone of the instance in the UTC mode.
    * Method local() returns a clone of the instance in the non-UTC (local) mode.
    * Method isUTC() checks, if the instance is in the UITC mode.
    * Method utcOffset() returns the time zone offset to UTC consistently with Date.prototype.getTimezoneOffset()
    
    Differences to the "normal" (local) dayjs mode:
    
    * Assume UTC as the time zone of the string passed to the constructor - for example, "2018-10-28" will be parsed as "2018-10-28T00:00:00Z". *But only if the time zone is omitted.* If you end the string tith a TZ offset - "2018-10-28T00:00:00+02:00", it will be retained and the whole date will be converted to UTC, when iniitalizing the datejs object.
    * Methods returning the date parts like year(), month() etc. return UTC parts using Date.propertotype.getUTC* methods.
    * Methods manipulating the date - set() - work with the UTC values of the date parts, as the getters above.
    * The format() method always formats the time zone as "+00:00".
    * The utcOffset() method always returns zero.
    prantlf committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    16581d7 View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2018

  1. Configuration menu
    Copy the full SHA
    beb80fc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e640b57 View commit details
    Browse the repository at this point in the history