Forums

non-required datetime box

chrissy6930 16 Jun, 2011
hi there,

I have one datetime box (date) that is required and a second datetime box (date_end) that is not.
both fields are set up as date

when checking a db entry with only date entered date_end is set to 0000-00-00 as expected

however when following an edit link on the form date_end would hold the value 2011-01-01

what am I overlooking ? when editing an entry in a form I would like the non-required date field to be either blank or display 0000-00-00.

and a second question:
is there a way to require that date_end is at least 1 day after date ?

J!1.5.23, CF 4 RC1.9
Max_admin 20 Jun, 2011
Hi Chrissy,

I will test this and get back to you.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
GreyHead 21 Jun, 2011
Hi Chrissy,

I think you need to use the allowEmpty: Yes option for the datetime picker. If this is not set and the date field is empty then the datepicker inserts today's date.

Bob
chrissy6930 21 Jun, 2011
hi Bob! welcome back!🙂

provided you mean adding the snippet in General tab - DateTime Picker config then yes that is working and I now get a 0000-00-00 when editing an entry

thanks for the hint!😀
chrissy6930 21 Jun, 2011
I do have another question though:

is there a way to require that date_end is at least 1 day after date, i.e. can I enter a min date for date_end somewhere?
Max_admin 13 Aug, 2011
Hi chrissy,

you need:

minDate: { date: '10-03-2009', format: 'd-m-Y' }


in a Custom Datepicker action with a custom class for your date picker element.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.