Hello,
My query has two simple parts:
- How to disable date picker. I just want the date field without the picker. How do I do that?
- How do I make the format dd/mm/yyyy. I looked at so many documents and saw d-m-Y format mentioned but I don't see a place to put it.
I searched a lot but found little about how exactly to do it. Nothing in FAQ. Do I have to use Css to change the format.
Regards, Amal
GreyHead,
- If I put '%d-%m-%Y' in "DateTime Picker config" then the picker stops working. I can specify anything.
- Is there a way I can put a null date with picker on? If that is ok then I am good with using it. I tried using 01-01-1970 but that is stored as it is.
I just noticed the table field created CFv4 for field corresponding to date picker is a varchar field. Is that correct. It stores any format I specify once the date picker is off.
Thanks, Amal
Hi Amal,
Have you turned the MooTools datepicker on?
The format string in the FAQ is format: '%m-%d-%Y' Have you included the format: part?
The database column is created in whatever format you specified, the default is VARCHAR(255) but you can - and should - change that.
Bob
GreyHead,
Yes, the MooTools Datepicker is on.
- The Moo DatePicker works only when the Style is specified as "Vista" otherwise it shows the default MonkeyPhysics date picker.
- If I specify any date format like '%m-%d-%Y' or '%d-%m-%Y', it stops showing the date.
- You didn't answer my other query, can I set the date to null or 0000-00-00 with any of the pickers.
I am using this setup on my localhost, WinXP based system running Wampserver and Firefox 23.0.1. You think it would be different on my Linux shared web hosting. I haven't yet tried it there but don't think it would behave differently.
Thanks
Amal
Hi Amal,
In my experience the MooTools Datepicker works with all the templates. If it's failing with the default template then something is broken.The same is true if the date format if you have it correctly specified.
I;m not clear what you mean by a Null date - if you want to save Null in the database table then I think that you'd have to have the column set to a default Null and save an empty string, or just remove the data entry from the $form->data array before saving.
Bob
GreyHead,
User has specified incorrect date for many rows by mistake. They are unable to blank them out or nullify them with the picker ON. That is one of my main issues for this post.
I am using the default Joomla Protostar template in fluid mode.
I hope you understood my earlier sentence "If I specify any date format like '%m-%d-%Y' or '%d-%m-%Y', it stops showing the date." I meant the date picker doesn't show up.
Any suggestions now that it is broken. Can I just enforce YYYY-MM-DD format without the picker.
Do I have to switch ON "JS Validation" or something.
Thanks
Amal
Hi Amal,
It has nothing directly to do with validation. it has to do with configuring the datepicker correctly and making sure that there are no JavaScript errors on the page so that it will work OK.
Bob
Hi,
Regarding the main question of the topic, you can do this also using some input masking script, this is not available in v4 by default, you will have to use a 3rd party js script to do it, or simply use v5 for this form only, it has a masking option for text fields.
Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.