I have such code:
<mat-form-field class="example-full-width">
<input
[matDatepicker]="picker"
formControlName="from"
matInput
/>
<mat-datepicker-toggle [for]="picker" matSuffix></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>
<div>{{element.get('from').value.toISOString()}}</div>
<div>{{element.get('from').value}}</div>
this._formBuilder.group({
from: [moment(source.from).local()]
})
I want that user will work with local timezone, but on server I want to send zero UTC offset.
Initially, it shows the correct date
But when I choose a different date from datepicker, it clears timezone from date for some reason. I don't need it.
Why it can be happening?
That was because of moment.tz.setDefault