bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

uib-datepicker-popup formatting problem

Open char0n opened this issue 11 years ago • 25 comments

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 displayed

When 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.

char0n avatar Oct 14 '15 10:10 char0n

@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 master, we can certainly take a look if a proper issue w/ reproduction is filed.

@MuhammadTayyeb please do not hijack threads. if you require support, please read our project README for how to properly ask for (and receive) help.

icfantv avatar Aug 25 '16 01:08 icfantv

Kindly see the attachment. when i am edit the date. but they can't show the Edit date. but it will available in backend

capture taee

MuhammadTayyeb avatar Aug 26 '16 22:08 MuhammadTayyeb

i use same DatePicker which you. i have issue occur when i am edit the datepciker

MuhammadTayyeb avatar Aug 26 '16 23:08 MuhammadTayyeb

I am had a similar problem. I use DatePicker popup in many places and I had this behavior:

  1. No issue when entering the date the first time;
  2. Issue when presenting the form for update. In spite the fact that the date is in ng-model and DatePicker show it when you open the calendar, the bar is blank.

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.

screen oggetto 1

screen oggetto 2

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:

var dateForDatePicker = new Date (dateFromDB);

and everything is working fine, with any formatting string.

white-hawk-feather avatar Aug 31 '16 10:08 white-hawk-feather

I confirm, also if the variable is a DateTime coming from a DB, during initialization you have to do:

yourDate = new Date(yourDate);

and everything works, no format issue.

white-hawk-feather avatar Aug 31 '16 13:08 white-hawk-feather