Open adamjez opened 6 years ago
I think it’s natural to bind properties directly to DateTimeOffset type, like:
<bp:DateTimePicker SelectedDate="{value: SelectedDate}" />
where SelectedDate
is DateTimeOffset
property.
I know there probably are serialization/controls-related issues with that now, but it would be the proper DateTimeOffset support in my opinion. The offset part should be the local timezone from browser (not UTC).
We should add support to
DateTimeOffset
type.In the current version of DotVVM, user that uses
DateTimeOffset
have to add anotherDateTime
property to viewModel to be able to properly formatDateTime
:It would be a much nicer to do it in a value binding:
{value: OccuredAt.LocalDateTime}
.There is a slight issue that rendering it server-side could result in different
DateTime
then rendering it client-side. We can use Internationalization API to get local timezone from browser.Then there is a question if we should support assigning to
DateTimeOffset
and if yes, how it should be done? What timezone should be used (local/utc)?