angular-datepicker icon indicating copy to clipboard operation
angular-datepicker copied to clipboard

Updating Calendar on input change

Open jonnycraze opened this issue 7 years ago • 6 comments

I apologize if this is addressed somewhere else, I just haven't found a clear answer one way or the other.

If I focus on an input with the date-time attribute, and update the value in the input field, is there a way to have that update the Calendar UI as well? I'm not seeing it in current examples but wondering if there is a way to do it.

Thanks much

jonnycraze avatar Feb 07 '17 22:02 jonnycraze

If I understood you correctly, you want to have both an input element and a div element using the same date, and if one is updated then the other should automatically update?

The only real thing you need to do is set all elements to use the same object, and set the watch-direct-changes="true" attribute on the div elements. See this plunkr for an example.

DanTalash avatar Feb 22 '17 15:02 DanTalash

I'm having the same issue as @jonnycraze .

When updating the input manually my model doesn't get updated. The fix @DanTalash suggests is not what I'm looking for, I don't have 2 calendars, just 1 where I want to be able to let the user edit the date from the input itself.

Another option is to disable direct input, but I can't find a solution for that.

mbaumrucker avatar Mar 17 '17 09:03 mbaumrucker

+1

dsvictorh avatar Mar 28 '17 07:03 dsvictorh

+1

payros avatar Sep 17 '17 21:09 payros

+1

philippone avatar Nov 15 '17 13:11 philippone

Another option is to disable direct input, but I can't find a solution for that.

Simply make the input field readonly to disable direct input flow

ArgV04 avatar Nov 17 '17 11:11 ArgV04