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

TimePicker shows current time when model is empty. #1114

Closed
functionportal opened this issue Oct 3, 2013 · 42 comments
Closed

TimePicker shows current time when model is empty. #1114

functionportal opened this issue Oct 3, 2013 · 42 comments

Comments

@functionportal
Copy link

TimePicker shows current time when the model is null or cleared. On the contrary, DatePicker is blank when model is empty, which is the correct approach. It is impossible to tell when the TimePicker model is not set by looking at the control. TimePicker should be blank when model is not set.

@coolaj86
Copy link

+1

@bekos
Copy link
Contributor

bekos commented Jan 11, 2014

After looking at this one, that seems a pretty easy fix, but the question is whether this is the default behavior we want or not, because adding another configuration parameter for this seems like an overkill. Also, after #1561 is merged, we can add another directive as an alternative option, but I am not sure if it's worth the trouble. WDYT?

@toners
Copy link

toners commented Jan 14, 2014

In the meantime - if I was to modify the existing version locally to suit the needs of my project - how would I set this to so that it appears blank unless edited? Thanks

@bekos
Copy link
Contributor

bekos commented Jan 14, 2014

@toners At updateTemplate. Change the $scope.hours, $scope.minutes to assign only when the $modelValue is not nul, else null.

@philippd
Copy link
Contributor

+1

3 similar comments
@mhermann84
Copy link

+1

@smayer
Copy link

smayer commented Apr 25, 2014

+1

@GFoley83
Copy link

GFoley83 commented Jul 8, 2014

+1

ulle added a commit to ulle/bootstrap that referenced this issue Aug 18, 2014
ulle added a commit to ulle/bootstrap that referenced this issue Aug 18, 2014
ulle added a commit to ulle/bootstrap that referenced this issue Aug 18, 2014
ulle added a commit to ulle/bootstrap that referenced this issue Aug 18, 2014
@jbthoma
Copy link

jbthoma commented Aug 22, 2014

+1

4 similar comments
@ppollono
Copy link

+1

@gogromat
Copy link

+1

@IGx89
Copy link

IGx89 commented Nov 25, 2014

+1

@knicklabs
Copy link

+1

@NuNn-DaDdY
Copy link

+1

1 similar comment
@iraj-jelo
Copy link

+1

@constellates
Copy link

+1

5 similar comments
@mciastek
Copy link

mciastek commented Feb 6, 2015

+1

@DefeNder93
Copy link

+1

@DigitalSmile
Copy link

+1

@deggesim
Copy link

+1

@ghost
Copy link

ghost commented Feb 24, 2015

+1

@lichtner
Copy link

lichtner commented Mar 4, 2015

+1 why don't merge this?

@szabyg
Copy link

szabyg commented Jul 9, 2015

@rvanbaalen I think I contributed to the discussion and in the last month no one responded to the points I made. Does that mean that you all agree? Shall we move on to implementation and a pull request? Who will merge it if no one feels responsible for the issue?

@fmccown
Copy link

fmccown commented Jul 14, 2015

If this would be helpful, here's my implementation of the timepicker that shows empty inputs when the given model is null.

@wesleycho wesleycho added this to the 0.13.3 (Performance) milestone Aug 2, 2015
@wesleycho wesleycho removed the PRs plz! label Aug 2, 2015
@wesleycho wesleycho self-assigned this Aug 2, 2015
@wesleycho
Copy link
Contributor

@szabyg I will move to implement this feature behind a feature flag, opting for the default behavior to be as requested here to match the datepicker and to allow what is requested in #1589 to be possible as well.

@wesleycho wesleycho modified the milestones: 0.13.3 (Fixes), 0.13.4 (Performance) Aug 9, 2015
@wesleycho wesleycho removed their assignment Aug 13, 2015
@wesleycho wesleycho modified the milestones: Backlog, 0.13.4 (Performance) Aug 13, 2015
@wesleycho
Copy link
Contributor

This is a much more difficult feature to implement than I expected - to properly do this has a lot of side-effects that needs to be accounted for.

I'm not sure it is as easy as people think.

@fmccown
Copy link

fmccown commented Aug 13, 2015

You're right... it is not easy to implement. Take a look at this Plunker where I've implemented it. The only thing I'm not real happy about is that $touched is set after moving from the hour field to the minute field, but otherwise it's a pretty good start.

@wesleycho
Copy link
Contributor

Mind making those changes and opening a PR? I can review it and help make it good to get in.

@fmccown
Copy link

fmccown commented Aug 13, 2015

Sure thing.

@helenev
Copy link

helenev commented Nov 26, 2015

Do you know when the fix for this issue will be on bower?

@icfantv
Copy link
Contributor

icfantv commented Nov 26, 2015

@helenev, I'm on my phone so I can't easily check. If this is in the 1.0 release, then we don't have a date yet as we have some things we need to finish up for it. Our goal is to release by the end of the year. If you want, feel free to pull master and run npm install followed by grunt to build the latest snapshot release. The generated files will be in the dist directory. Please note that this release has a TON of breaking changes so make sure you look at the changelog.

@ZackBotkin
Copy link

Was this ever fixed?

@mfsi-surajs
Copy link

+1
any workaround to clear that field when model is null ?

@joaoesantos
Copy link

Im still not able to fix this, any workaround on thsi?

@spwinner2017
Copy link

spwinner2017 commented Feb 1, 2019

+1
I have set this.medicineForm.get('startTime').setValue(Date.now()); but its not chaging when i select another time ...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.