symfony2admingenerator / AvocodeFormExtensionsBundle

(old-legacy) Symfony2 form extensions for Admingenerator project (also working standalone!)
Other
48 stars 31 forks source link

daterange_picker inserts wrong date #57

Open madc opened 10 years ago

madc commented 10 years ago

I already mentioned it somewhere, the daterange_picker inserts a wrong date. Instead of something like '2013-08-11 - 2013-09-11' it inserts '2013-00-11 - 2013-00-11'.

The format should be

format:           "yyyy-MM-dd",

instead of

format:           "yyyy-mm-dd",

Also an option to format the date would proof helpful.

Thanks.

/m

satiricon commented 10 years ago

+1 I am trying to find a fix for the same problem using the admin generator, but to no avail. I guess I'll leave the date range fields for later and wait for a fix.

madc commented 10 years ago

I just found out, that it is possible to overwrite the 'format' option with the 'formatSubmit' option, what exactly solved this problem.

'formatSubmit' => 'dd.MM.yyyy',
satiricon commented 10 years ago

@madc I tried it. But when I use formatSubmit, it throws a javascript side error.

Uncaught TypeError: Cannot call method 'getMonth' of null
satiricon commented 10 years ago

Ok, if I use, for example: formatSubmit: 'yyyy-MM-dd' it works flawlessly but if change that format it throws the javascript error.

madc commented 10 years ago

You have to be sure to use a format, that is recognized by moment.js

ioleo commented 10 years ago

The format option for date widgets has it's limits right now. I was not able to spend more time and find a more flexible solution. I guess it would be a good idea to discuss to what extend we need date, time and currency localized? Which standards we should use? Some widgets (used here) have their own formatting options and transforming the formats can be really a pain in the ass.

What we actually need is some new JS date/time picker widget that uses a good standard. Pickadate looks nice but it does not have a date-range option and it also uses it's own formatting rules instead of implementing a more widely accepted standard.

madc commented 10 years ago

In my opinion, pickadate is like a slap into my face. Is there no complete lib for bootstrap styled inputs? But maybe this discussion should be topic of a new issue?

ioleo commented 10 years ago

@madc Opened another issue with a discussion.

fadoe commented 10 years ago

@loostro i think this issue can be closed?

ioleo commented 10 years ago

@fadoe i'll test it