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

Setting UTCOffset #620

Closed
dennisgaebel opened this issue Jun 25, 2019 · 6 comments · Fixed by #668
Closed

Setting UTCOffset #620

dennisgaebel opened this issue Jun 25, 2019 · 6 comments · Fixed by #668
Labels
🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt released

Comments

@dennisgaebel
Copy link

dennisgaebel commented Jun 25, 2019

Issuehunt badges

I'm currently converting from moment.js, and was curious how to set the value of utcOffset()?

Here's an example of my code where you can see how it was being used with moment.js and the example beneath is my day.js conversion however, I can't set the utcOffset properly whereas my set methods are currently doing their job as they should be in the day.js conversion code.

moment.js

moment(currentDate).utcOffset(0).set({hour: 0, minute: 0, second: 0, millisecond: 0})

current day.js conversion work

dayjs(currentDate).set('hour', 0).set('minute', 0).set('second', 0).set('millisecond', 0)

IssueHunt Summary

iamkun iamkun has been rewarded.

Backers (Total: $100.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

@ghost
Copy link

ghost commented Aug 21, 2019

Setting UTCOffset like dayjs().utsOffset(540) is a very important feature.

It's the base of implementing timezone feature.

Besides, with setting utcoffset, we can simulate some of the tz feature ourself.

@iamkun
Copy link
Owner

iamkun commented Aug 21, 2019

Note that once you set an offset, it's fixed and won't change on its own (i.e there are no DST rules). If you want an actual time zone -- time in a particular location, like America/Los_Angeles, consider Intl.DateTimeFormat

@dennisgaebel
Copy link
Author

ty! 👌

@iamkun iamkun reopened this Aug 21, 2019
@issuehunt-oss
Copy link

issuehunt-oss bot commented Aug 27, 2019

@issuehunt has funded $100.00 to this issue.


@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label Aug 27, 2019
@issuehunt-oss
Copy link

issuehunt-oss bot commented Sep 16, 2019

@iamkun has rewarded $90.00 to @iamkun. See it on IssueHunt

  • 💰 Total deposit: $100.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $10.00

@issuehunt-oss issuehunt-oss bot added 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt and removed 💵 Funded on Issuehunt This issue has been funded on Issuehunt labels Sep 16, 2019
@iamkun
Copy link
Owner

iamkun commented Nov 6, 2019

🎉 This issue has been resolved in version 1.8.17 🎉

The release is available on:

Your semantic-release bot 📦🚀

@iamkun iamkun added the released label Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants