-
Notifications
You must be signed in to change notification settings - Fork 6.7k
uib-datepicker-popup formatting problem #4616
Comments
Further investigation revealed the cause of the problem. The behavior is not expected only where there is additional attribute on input: |
Hi, Here is the plnkr: http://plnkr.co/edit/FMHFNyzC6jlfd43uz6vF?p=preview I forked the plnkr from @Neilski from #4607 and change version to 0.14.2. Seems like a 100% duplicate. |
Thank you for your continued help. Using your demo at http://angular-ui.github.io/bootstrap/#/datepicker, if I change line #36 from: To: In other words I replace the uib-datepicker-popup value from "{{format}}" to the UK date format of "dd/MM/yyyy" the initial model value is nulled in the first of the two popup date input fields. This only seems like a problem if:
Hope this helps. |
Yes, I can confirm. Thanks. The only workaround I could come up with is to use old |
@Neilski, you're missing some text from your comment. |
Thank you for your continued help. Using your demo at http://angular-ui.github.io/bootstrap/#/datepicker When the page loads, observe that the first date input field (under the 'Popup' heading) contains the value of the date ('15-October-2015') If you then change line #36 from:
to:
when the page is refreshed note that the input field is now blank. In other words if I replace the uib-datepicker-popup value from This only seems like a problem if:
Hope this helps. |
I'm still investigating this, but if you change You should be able to use this as a workaround in the interim. |
Even more strange is that if I change line #36 of the example.js from
to
and then change the default formats selection from zero to two (to select the 'dd/MM/yyy' array element on line #37
It works too. It almost seems to be that the data is being bound before the format statements are being evaluated when the format is presented inline. |
I have done a little more testing and I think I can explain the problem. In fact, the problem only exists if you define the date format inline
if you define the format in the scope
and
Then everything works as expected. I am guessing that this is due to the ordering of the JavaScript controller and the parsing of the HTML properties. In this respect, the behaviour is understandable if not intuitive. |
i'm having someone smarter than I look at this. the workaround stinks, but at least one exists. |
If you follow the example of the documentation https://angular-ui.github.io/bootstrap/#/getting_started, you can see using a controller to manage the scope . In my case, if I put a directive does not work. With a controller Yes! |
Hi, I have another problem with the format, it is that when I use a literal character, the scope loses its value. For example, "dd 'of' MMMM" or "longDate" which also has literal characters I made a plunker so you can see how it affects the problem when a calendar date is selected: Does anyone know how to fix this? Thank you |
Im having similar error: Version 0.14.3
|
@alphapilgrim 0.14.3 is quite old at this point. you might want to try 1.3.3 or 2.0.0 (but there are some issues w/ nested modals and datepicker model options) in 2.0. |
@icfantv migration to new version is pretty much impossible right now. I need a solution. |
@alphapilgrim, ok. just so you know, we do not issue patches for back versions. |
@icfantv has this been a known bug? |
when i edit Datepicker the can't pickup the data. |
@alphapilgrim, sorry, it's been too long at this point. are you asking if it's a known bug in 0.14.3? if so, i have no idea. if it's a bug in @MuhammadTayyeb please do not hijack threads. if you require support, please read our project README for how to properly ask for (and receive) help. |
i use same DatePicker which you. i have issue occur when i am edit the datepciker |
I am had a similar problem. I use DatePicker popup in many places and I had this behavior:
Here 2 samples of the situation I described with the json of the objects and the dates. You see that the first one has the issue, the second no. Observing the dates I realized that the ones coming from user input have milliseconds, the ones coming from DB do not have milliseconds. I changed the code to have the milliseconds and everything worked fine. The simplest way is doing something like this:
and everything is working fine, with any formatting string. |
I confirm, also if the variable is a DateTime coming from a DB, during initialization you have to do:
and everything works, no format issue. |
Hi,
There seems to be a problem with uib-datepicker-popup and formatting. I am currently using version 0.14.2 but I can confirm that affected was also 0.14.1. The problem is when I declare in html datepicker popup like this:
<input ...uib-datepicker-popup="dd/MM/yyyy"... />
- the date will not be in displayedWhen I fallback to
<input ...datepicker-popup="dd/MM/yyyy"... />
- the date will be displayed correctly but I see the deprecation message.It seems to be a regression in behavior for datepicker-popup. Also note that
uib-datepicker-popup="yyyy-MM-dd" works as expected. But when you change the format to anything different the dates are not displayed anymore.
The text was updated successfully, but these errors were encountered: