question-mark
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.

[DatePicker] Single DateSelector Conversion time zone error

See original GitHub issue

Description: setSelection in SingleDateSelector converts date in UTC date. Assume a scenario where the user is in India (+5:30). The time is 13/jul/2020 5am local time. setSelection in SingleDateSelector is giving in mill sec the function creates a calender object at UTC the date would be 12/jul/2020 . The selected date in the ui would be 12/jul/2020 rather than 13/jul/2020 which was the input.

Expected behavior: expected behavior should be date should be converted based on system default setting rather than UTC.

Source code:

@Override
 public void setSelection(@Nullable Long selection) {
   selectedItem = selection == null ? null : UtcDates.canonicalYearMonthDay(selection);
 }

Material Library version: Material Android Library version you are using here 1.1.0

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
matpagcommented, Jul 14, 2020

Great! 😃 We can close the issue

You will need to move to the next 1.3.0-alpha02 when it will be released (better not depending on generic snapshot version). In the meantime you can use a “pinned” snapshot like this one: 1.3.0-dev-20200619

0reactions
hunterstichcommented, Jul 14, 2020

Nice. Going ahead and closing this

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not able to set default time zone for date picker #1787 - GitHub
Since the inputs are converted internally, the UI elements will adjust the time based on the UTC offset. Output dates (e.g. onChange call...
Read more >
jQuery Date Picker - TimeZone Issue - Stack Overflow
When they select a time from the datepicker, just pass it back as is (if they selected 9PM, just pass back 9PM). On...
Read more >
Date Picker Sends Wrong Date - Power Platform Community
But when it saves it to Excel its converting to UTC, which is evidently two hours before your current timezone. So the date...
Read more >
DatePickerSingle | Dash for Python Documentation | Plotly
After the user chooses a new date, there will be no time part—only the date. If you already have a datetime.datetime object, you...
Read more >
How to use date time picker in PowerApps - SPGuides
In this tutorial, we will check PowerApps date time picker. ... So to convert the Date Time Zone in PowerApps, the Date Picker...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found