danielmoncada / date-time-picker

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

Issue when time picker value change #34

Closed dhavalsolankislk closed 4 years ago

dhavalsolankislk commented 4 years ago

Hello,

We are using date-time-picker in our application. We have a problem that when we are facing a issue that when we are changing time picker value and click on set button with in 500ms the value is not reflected. So in the datepicker text field value of minutes or hour which we have set remains as it is and the new value is not reflected.

kamlesh0606 commented 4 years ago

@danielmoncada - Any Update ?

danielmoncada commented 4 years ago

@dhavalsolankislk is the new value reflected AFTER 500ms?

dhavalsolankislk commented 4 years ago

@danielmoncada New value is reflected after 1000ms

danielmoncada commented 4 years ago

Okay, thanks @dhavalsolankislk . I'll look into this later today (it's almost 1AM here). Any reason why you need to have it reflect right away?

dhavalsolankislk commented 4 years ago

@danielmoncada We need to reflect right away as here text field of minute and set button is very near, so our client instantly click on set button after setting value of minutes within 500ms

Attaching the snap of it date

dhavalsolankislk commented 4 years ago

@danielmoncada any update ?

dhavalsolankislk commented 4 years ago

@danielmoncada Any update ?

danielmoncada commented 4 years ago

@dhavalsolankislk I cannot reproduce this in the demo app of the repo. As soon as I press 'Set', the time is reflected immediately in the TextBox.

Can you post your HTML / component.ts code?

dhavalsolankislk commented 4 years ago

Hello, @danielmoncada Our html code is as below

<div class="form-group mr-2">
                <label class="control-label"> {{'To'|translate}} *</label>
                <div class="input-inside-btn input-inside-btn-style-1">
                    <input class="form-control" [owlDateTimeTrigger]="dt2" placeholder="DD-MM-YYYY HH:MM"
                        [owlDateTime]="dt2" formControlName="toDate">
                    <owl-date-time [pickerType]="'both'" #dt2></owl-date-time>
                    <button type="button" class="btn btn-icon-none" [owlDateTimeTrigger]="dt2">
                        <i class="ik-l-55 micon-calendar overlap-icon color-primary"></i>
                    </button>
                </div>
            </div>

Not specific code in ts file

Issue is reproduced in below link https://danielykpan.github.io/date-time-picker/

danielmoncada commented 4 years ago

@dhavalsolankislk thanks for the snippet.

As per your link, which example is the issue occurring at? When I change the time and immediately click SET, it's reflected in the TextBox right away (and not haver 1000 ms).

kamlesh0606 commented 4 years ago

Hi, @danielmoncada Problem generated below photo with given link (https://danielykpan.github.io/date-time-picker/)

image

Video For above problem: screen-capture.zip

allyen commented 4 years ago

This is caused by https://github.com/danielmoncada/date-time-picker/blob/master/projects/picker/src/lib/date-time/timer-box.component.ts#L85. If you click 'Set' before the debunceTime elapses, the value is not persisted. I believe the debounceTime could be safely removed since the user can write only two numbers and furtheremore no complex logic takes place after the time is set.

danielmoncada commented 4 years ago

fixed with https://github.com/danielmoncada/date-time-picker/pull/53