danielmoncada / date-time-picker

Angular Date Time Picker (Responsive Design)
https://daniel-projects.firebaseapp.com/owlng/date-time-picker
MIT License
141 stars 61 forks source link

Date Time Range Picker - Changing time in input doesn't reflect #76

Closed Ajayachathru closed 3 years ago

Ajayachathru commented 3 years ago

I'm using Angular, 8 ng-pick-datetime version 7.0.0

In https://danielykpan.github.io/date-time-picker/ Use with @angular/forms section,

Click Date Time Range Picker, choose same date in from & to type in from time as 08:00:00 type in to time as 08:15:00

only seconds gets changed as 15, hours not changed !

Ajayachathru commented 3 years ago

HI,

can't enter same Hour / Minute / Second in from & to time.

After debugging, Understood the issue in timer-box.component.js you are maintaining single inputStream for both from and to time.

distinctUntilChanged() will not emit when the same value is entered. we need to remove it or maintain separate streams for from & to time.

please fix this soon in ng-pick-datetime 7.0.0

Issue: OwlTimerBoxComponent.prototype.ngOnInit = function () { var _this = this; this.inputStreamSub = this.inputStream.pipe(debounceTime(500), distinctUntilChanged()).subscribe(function (val) {
if (val) { var inputValue = coerceNumberProperty(val, 0); _this.updateValueViaInput(inputValue); } }); };

Fix: OwlTimerBoxComponent.prototype.ngOnInit = function () { var _this = this; this.inputStreamSub = this.inputStream.pipe(debounceTime(500)).subscribe(function (val) {
if (val) { var inputValue = coerceNumberProperty(val, 0); _this.updateValueViaInput(inputValue); } }); };

danielmoncada commented 3 years ago

@Ajayachathru thanks for your feedback.

I am not maintaining ng-pick-datetime 7.0.0. This current library is forked from that because it was no longer mainted.

I can look into fixing the issue here, as part of @danielmoncada/angular-datetime-picker

Ajayachathru commented 3 years ago

@danielmoncada

sure, thanks :+1:

Ajayachathru commented 3 years ago

Hi @danielmoncada

Have you fixed this issue ?

danielmoncada commented 3 years ago

@Ajayachathru no, I'm busy at work with the moment, so I haven't had a chance. Feel free to fix it yourself and make a PR if you want

Ajayachathru commented 3 years ago

Hi @danielmoncada

Okay. I'll fix it and make a PR by tomorrow evening.

danielmoncada commented 3 years ago

@Ajayachathru thanks, let me look over the PR. 👍

Ajayachathru commented 3 years ago

Hi @danielmoncada .. can you please check and merge this

danielmoncada commented 3 years ago

@Ajayachathru taking a look now! thanks

danielmoncada commented 3 years ago

@Ajayachathru published! thanks again https://www.npmjs.com/package/@danielmoncada/angular-datetime-picker/v/10.1.0

Ajayachathru commented 3 years ago

thanks :) @danielmoncada