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

Timezone Plugin #974

Merged
merged 2 commits into from
Jul 30, 2020
Merged

Timezone Plugin #974

merged 2 commits into from
Jul 30, 2020

Conversation

zazzaz
Copy link
Contributor

@zazzaz zazzaz commented Jul 30, 2020

Add timezon plugin

// parse
dayjs.tz("2014-06-01 12:00", "America/New_York")

// convert
dayjs("2014-06-01 12:00").tz("America/New_York")

// guess
dayjs.tz.guess()

Thanks luxon and ‎Intl.DateTimeFormat()


Update: https://day.js.org/docs/en/timezone/timezone

@codecov
Copy link

codecov bot commented Jul 30, 2020

Codecov Report

Merging #974 into dev will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##               dev      #974   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          169       170    +1     
  Lines         1435      1476   +41     
  Branches       307       311    +4     
=========================================
+ Hits          1435      1476   +41     
Impacted Files Coverage Δ
src/plugin/timezone/index.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6969e89...906de2f. Read the comment docs.

@iamkun
Copy link
Owner

iamkun commented Jul 30, 2020

Many thanks

@iamkun iamkun merged commit e69caba into iamkun:dev Jul 30, 2020
describe('Convert', () => {
it('convert to target time', () => {
const losAngeles = dayjs('2014-06-01T12:00:00Z').tz('America/Los_Angeles')
const MlosAngeles = dayjs('2014-06-01T12:00:00Z').tz('America/Los_Angeles')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be a typo here, shouldn't this use moment.tz instead of dayjs?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, ha

iamkun pushed a commit that referenced this pull request Aug 4, 2020
## [1.8.32](v1.8.31...v1.8.32) (2020-08-04)

### Bug Fixes

* Add Experimental Timezone Plugin ([#974](#974)) ([e69caba](e69caba))
* fix parse date string error e.g. '2020/9/30' ([#980](#980)) ([231790d](231790d)), closes [#979](#979)
* update monthDiff function to get more accurate results ([19e8a7f](19e8a7f))
* Update UTC plugin to support keepLocalTime ([#973](#973)) ([9f488e5](9f488e5))
@iamkun
Copy link
Owner

iamkun commented Aug 4, 2020

🎉 This PR is included in version 1.8.32 🎉

The release is available on:

Your semantic-release bot 📦🚀

@iamkun iamkun added the released label Aug 4, 2020
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this pull request May 10, 2022
## [1.8.32](iamkun/dayjs@v1.8.31...v1.8.32) (2020-08-04)

### Bug Fixes

* Add Experimental Timezone Plugin ([#974](iamkun/dayjs#974)) ([e69caba](iamkun/dayjs@e69caba))
* fix parse date string error e.g. '2020/9/30' ([#980](iamkun/dayjs#980)) ([231790d](iamkun/dayjs@231790d)), closes [#979](iamkun/dayjs#979)
* update monthDiff function to get more accurate results ([19e8a7f](iamkun/dayjs@19e8a7f))
* Update UTC plugin to support keepLocalTime ([#973](iamkun/dayjs#973)) ([9f488e5](iamkun/dayjs@9f488e5))
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this pull request May 10, 2022
## [1.8.32](iamkun/dayjs@v1.8.31...v1.8.32) (2020-08-04)

### Bug Fixes

* Add Experimental Timezone Plugin ([#974](iamkun/dayjs#974)) ([e69caba](iamkun/dayjs@e69caba))
* fix parse date string error e.g. '2020/9/30' ([#980](iamkun/dayjs#980)) ([231790d](iamkun/dayjs@231790d)), closes [#979](iamkun/dayjs#979)
* update monthDiff function to get more accurate results ([19e8a7f](iamkun/dayjs@19e8a7f))
* Update UTC plugin to support keepLocalTime ([#973](iamkun/dayjs#973)) ([9f488e5](iamkun/dayjs@9f488e5))
splashwizard pushed a commit to splashwizard/tracking-time that referenced this pull request Oct 21, 2024
## [1.8.32](iamkun/dayjs@v1.8.31...v1.8.32) (2020-08-04)

### Bug Fixes

* Add Experimental Timezone Plugin ([#974](iamkun/dayjs#974)) ([e69caba](iamkun/dayjs@e69caba))
* fix parse date string error e.g. '2020/9/30' ([#980](iamkun/dayjs#980)) ([231790d](iamkun/dayjs@231790d)), closes [#979](iamkun/dayjs#979)
* update monthDiff function to get more accurate results ([19e8a7f](iamkun/dayjs@19e8a7f))
* Update UTC plugin to support keepLocalTime ([#973](iamkun/dayjs#973)) ([9f488e5](iamkun/dayjs@9f488e5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants