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

Only changing the timezone (similar to moment.tz(keeptime=true)) #1149

Closed
smblee opened this issue Oct 19, 2020 · 3 comments · Fixed by #1161
Closed

Only changing the timezone (similar to moment.tz(keeptime=true)) #1149

smblee opened this issue Oct 19, 2020 · 3 comments · Fixed by #1161
Labels

Comments

@smblee
Copy link

smblee commented Oct 19, 2020

Here is a code sample from Moment's timezone. I would like to achieve the true flag so only the offset changes when time stays the same.

var m = moment.tz("2013-11-18 11:55", "America/Toronto");
m.format();                           // 2013-11-18T11:55:00-05:00
m.tz('Europe/Berlin', true).format()  // 2013-11-18T11:55:00+01:00

The use case would be:

I have something like an open hour: 08:00 to 16:00, and want to set that as America/New_York, i.e. 8:00 AM EDT to 16:00PM EDT.

Current behavior:

dayjs("08:00", "hh:mm").tz('America/New_York') => 2020-10-19T11:00:00-04:00 (depending on current timezone, in this case, America/Los_Angeles)

Desired behavior:

dayjs("08:00", "hh:mm").tz('America/New_York', true) => 2020-10-19T08:00:00-04:00
@smblee
Copy link
Author

smblee commented Oct 21, 2020

@iamkun bumping this issue. Is this feature already available?

@iamkun
Copy link
Owner

iamkun commented Oct 21, 2020

Sure, we will support this #1161

iamkun pushed a commit that referenced this issue Oct 23, 2020
## [1.9.4](v1.9.3...v1.9.4) (2020-10-23)

### Bug Fixes

* Add descriptions to types ([#1148](#1148)) ([9a407a1](9a407a1))
* add devHelper plugin ([#1163](#1163)) ([de49dc8](de49dc8))
* Fix Hungarian (hu) locale ([#1112](#1112)) ([ab13754](ab13754))
* fix minMax plugin parsing empty array bug ([#1062](#1062)) ([368108b](368108b))
* update adding/subtracting Duration from Dayjs object ([#1156](#1156)) ([f861aca](f861aca))
* update en-NZ locale to use proper ordinal formatting function ([#1143](#1143)) ([fcdbc58](fcdbc58))
* update localeData plugin type ([#1116](#1116)) ([ee5a4ec](ee5a4ec))
* update timezone plugin to support custom parse format ([#1160](#1160)) ([48cbf31](48cbf31)), closes [#1159](#1159)
* update timezone plugin to support keepLocalTime ([#1161](#1161)) ([1d429e5](1d429e5)), closes [#1149](#1149)
@iamkun
Copy link
Owner

iamkun commented Oct 23, 2020

🎉 This issue has been resolved in version 1.9.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this issue May 10, 2022
## [1.9.4](iamkun/dayjs@v1.9.3...v1.9.4) (2020-10-23)

### Bug Fixes

* Add descriptions to types ([#1148](iamkun/dayjs#1148)) ([9a407a1](iamkun/dayjs@9a407a1))
* add devHelper plugin ([#1163](iamkun/dayjs#1163)) ([de49dc8](iamkun/dayjs@de49dc8))
* Fix Hungarian (hu) locale ([#1112](iamkun/dayjs#1112)) ([ab13754](iamkun/dayjs@ab13754))
* fix minMax plugin parsing empty array bug ([#1062](iamkun/dayjs#1062)) ([368108b](iamkun/dayjs@368108b))
* update adding/subtracting Duration from Dayjs object ([#1156](iamkun/dayjs#1156)) ([f861aca](iamkun/dayjs@f861aca))
* update en-NZ locale to use proper ordinal formatting function ([#1143](iamkun/dayjs#1143)) ([fcdbc58](iamkun/dayjs@fcdbc58))
* update localeData plugin type ([#1116](iamkun/dayjs#1116)) ([ee5a4ec](iamkun/dayjs@ee5a4ec))
* update timezone plugin to support custom parse format ([#1160](iamkun/dayjs#1160)) ([48cbf31](iamkun/dayjs@48cbf31)), closes [#1159](iamkun/dayjs#1159)
* update timezone plugin to support keepLocalTime ([#1161](iamkun/dayjs#1161)) ([1d429e5](iamkun/dayjs@1d429e5)), closes [#1149](iamkun/dayjs#1149)
andrewhood125ruhuc added a commit to andrewhood125ruhuc/SidRH2 that referenced this issue May 10, 2022
## [1.9.4](iamkun/dayjs@v1.9.3...v1.9.4) (2020-10-23)

### Bug Fixes

* Add descriptions to types ([#1148](iamkun/dayjs#1148)) ([9a407a1](iamkun/dayjs@9a407a1))
* add devHelper plugin ([#1163](iamkun/dayjs#1163)) ([de49dc8](iamkun/dayjs@de49dc8))
* Fix Hungarian (hu) locale ([#1112](iamkun/dayjs#1112)) ([ab13754](iamkun/dayjs@ab13754))
* fix minMax plugin parsing empty array bug ([#1062](iamkun/dayjs#1062)) ([368108b](iamkun/dayjs@368108b))
* update adding/subtracting Duration from Dayjs object ([#1156](iamkun/dayjs#1156)) ([f861aca](iamkun/dayjs@f861aca))
* update en-NZ locale to use proper ordinal formatting function ([#1143](iamkun/dayjs#1143)) ([fcdbc58](iamkun/dayjs@fcdbc58))
* update localeData plugin type ([#1116](iamkun/dayjs#1116)) ([ee5a4ec](iamkun/dayjs@ee5a4ec))
* update timezone plugin to support custom parse format ([#1160](iamkun/dayjs#1160)) ([48cbf31](iamkun/dayjs@48cbf31)), closes [#1159](iamkun/dayjs#1159)
* update timezone plugin to support keepLocalTime ([#1161](iamkun/dayjs#1161)) ([1d429e5](iamkun/dayjs@1d429e5)), closes [#1149](iamkun/dayjs#1149)
allmoviestvshowslistsfilmography28 added a commit to allmoviestvshowslistsfilmography28/dayjs that referenced this issue Sep 12, 2024
## [1.9.4](iamkun/dayjs@v1.9.3...v1.9.4) (2020-10-23)

### Bug Fixes

* Add descriptions to types ([#1148](iamkun/dayjs#1148)) ([7400378](iamkun/dayjs@7400378))
* add devHelper plugin ([#1163](iamkun/dayjs#1163)) ([fa3d829](iamkun/dayjs@fa3d829))
* Fix Hungarian (hu) locale ([#1112](iamkun/dayjs#1112)) ([153d268](iamkun/dayjs@153d268))
* fix minMax plugin parsing empty array bug ([#1062](iamkun/dayjs#1062)) ([6de1f5b](iamkun/dayjs@6de1f5b))
* update adding/subtracting Duration from Dayjs object ([#1156](iamkun/dayjs#1156)) ([a481a16](iamkun/dayjs@a481a16))
* update en-NZ locale to use proper ordinal formatting function ([#1143](iamkun/dayjs#1143)) ([9e1e68a](iamkun/dayjs@9e1e68a))
* update localeData plugin type ([#1116](iamkun/dayjs#1116)) ([eba7980](iamkun/dayjs@eba7980))
* update timezone plugin to support custom parse format ([#1160](iamkun/dayjs#1160)) ([92fffe8](iamkun/dayjs@92fffe8)), closes [#1159](iamkun/dayjs#1159)
* update timezone plugin to support keepLocalTime ([#1161](iamkun/dayjs#1161)) ([9a0e271](iamkun/dayjs@9a0e271)), closes [#1149](iamkun/dayjs#1149)
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 a pull request may close this issue.

2 participants