Default date in calendar field

This forum is for general questions about extensions for Joomla! 3.x.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
Franck-C
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Wed Jul 13, 2016 1:08 pm

Default date in calendar field

Post by Franck-C » Fri Jul 15, 2016 8:29 am

Hello,
I'm developping a module that use the calendar.
In my .xml file I have :

Code: Select all

   <field
      name="start"
      type="calendar"
      format="%Y"
      default="2019"
      label="MOD_INFORMATION_FIELD_START_YEAR_LABEL"
      description="MOD_INFORMATION_FIELD_START_YEAR_DESC" />
But when I go to the administration of the module the result is not as expected :
The year in the field is at "1970" and the date selected when I click on the calendar icon is the date of the prensent day.
Moreover when I save my parameter (ex : "2015") and I go back to the Edit panel, the date is again at "1970". Each time I want to change one parameter I also have to change the date.

Can someone tell me how the "default" option work?

Thank you!
You do not have the required permissions to view the files attached to this post.

rahuljoomdev
Joomla! Apprentice
Joomla! Apprentice
Posts: 33
Joined: Tue Aug 23, 2016 8:05 pm

Re: Default date in calendar field

Post by rahuljoomdev » Mon Aug 29, 2016 10:14 pm

Hello,

You can have a look at this doc. It has all you need to set the default date too your choice.

https://docs.joomla.org/Calendar_form_field_type


Hope this works for you.

Thanks

Franck-C
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Wed Jul 13, 2016 1:08 pm

Re: Default date in calendar field

Post by Franck-C » Wed Aug 31, 2016 9:52 am

Thanks for your answer but I already put the default date :

Code: Select all

<field
      name="start"
      type="calendar"
      format="%Y"
      default="2019"
      label="MOD_INFORMATION_FIELD_START_YEAR_LABEL"
      description="MOD_INFORMATION_FIELD_START_YEAR_DESC" />
The date is pre-selected but not selected :
If I click on the calendar (in the edit mode) the date displayed is the default date but if if dont click on a date in this calendar and I save the changement of the module the date saved is 1970.


Locked

Return to “Extensions for Joomla! 3.x”