angulardart / angular_components

The official Material Design components for AngularDart. Used at Google in production apps.
https://pub.dev/packages/angular_components
374 stars 123 forks source link

fix: DatePicker.dateTime() setter doesn't set correct date in local time #415

Closed ayushin closed 5 years ago

ayushin commented 5 years ago

When the time UTC is in different date than time in local time, the dateTime setter will wrongly set the UTC date.

An easy fix is to pass `tzOffset: DateTime().now().tzOffset to Date.fromTime() (implemented) or convert _dateTime.toLocal() as the _dateTime might be/likely to be in UTC.

googlebot commented 5 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

ayushin commented 5 years ago

I signed it

googlebot commented 5 years ago

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

TedSander commented 5 years ago

Date.fromTime takes the timezone information from the time object itself. It is the responsibility for the passed time object to have the right timezone. This would break that functionality, and shouldn't be needed.