Skip to content
This repository has been archived by the owner on Oct 5, 2019. It is now read-only.

Model only updates on Datepicker changes (Timepicker changes only take affect on a Datepicker change) #191

Open
ZackDeRose opened this issue Sep 7, 2017 · 3 comments

Comments

@ZackDeRose
Copy link

The date object is only updating when making changes to the DatePicker.

If changes are made via the TimePicker, the date object is not updated. However the date object will reflect a time that matches the TimePicker if a selection is made to the DatePicker.

demonstration:
https://youtu.be/0rSqfr_JSV0

my html:

<datetime [(ngModel)]="date"></datetime>
<div>
  {{ date | date:'medium' }}
</div>

my typescript:

import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-test',
  templateUrl: './test.component.html',
  styleUrls: ['./test.component.css']
})
export class TestComponent implements OnInit {
  date: Date;

  constructor() { }

  ngOnInit() {
    this.date = new Date(Date.now());
  }

}
@phs92
Copy link

phs92 commented Dec 7, 2017

Same problem for me

@begozcan
Copy link

Same for me too

@phs92
Copy link

phs92 commented Jan 26, 2018

I fixed this in PR #213

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants