Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prevent dates from being adjusted by a User's timezones

See original GitHub issue

When a date is passed as 2018-01-01 to the component as a string via the value prop, it gets converted to a JavaScript Date object.

The user’s timezone reflects during this conversion.

A user in New York will see 2017-12-31 on his datepicker component rather than 2018-01-01 because GMT-4

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

mykeelscommented, May 31, 2018

Oh, nice! It’s been open for a few months now @charliekassel … It would be really helpful if it’s merged.

mykeelscommented, May 31, 2018

@charliekassel In my use case, I am binding the value to the datepicker component from a PHP blade template, not using it within another vue component where I’d be able to manipulate a date before passing it as a prop, so I have to use a string.

One way to get around this is to convert the date-string to reflect the user’s timezone, basically suffix it with 00:00:00 GMT-4

However, a prop that tells the datepicker to ignore the time part of the date (or lack thereof) would be helpful.

If it’s a datepicker, it makes sense that it should be able to be concerned with just dates and not their time values.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to ignore user's time zone and force Date() use specific ...
To account for milliseconds and the user's time zone, use the following: ... //re-initialize the Date function to reverse the timezone adjustment var...
Read more >
Allow or Prevent Users to Change Time Zone in Windows 10
To Prevent Users or Groups from Changing the Time Zone Windows 10, ; Local Security Policy will open. Go to User Local Policies...
Read more >
Ignore User's Time Zone on Certain Date Fields - IdeaExchange
We would like the ability to turn off User Time Zone adjusting when creating Date Fields. For example: you are in Pacific Time...
Read more >
Working with dates and timezones in JavaScript - Ursa Health
A helpful primer for working with dates and timezones in Javascript. ... as you're trying to get times working sensibly for all your...
Read more >
A Wrinkle in Time Keeping - The New York Times
If you do not want to stop your phone's calendar from adjusting itself, take an alternative approach. When you schedule a meeting to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found