Welcome, Guest
Username: Password: Remember me

TOPIC: [FIXED] Date format - Invalid Value on Null

[FIXED] Date format - Invalid Value on Null 13 May 2012 08:14 #2326

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
  • Karma: 30
If i have a calender field with no value to start withso it uses null, so 0000-00-00 (%Y-%m-%d).
But as i want to have my date to use a %d-%m-%Y format, if i want to save the form without entering a value for the date, it gives me an incorrect value.
Two stupid solutions are to ask the user to clear the calendar field prior to saving, and the other one is to kill the validator.
How could i state that the null value for a %d-%m-%Y formatted date field should be 00-00-0000 ?
Thanks,
The administrator has disabled public write access.

Re: Date format - Invalid Value on Null 13 May 2012 11:57 #2332

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
  • Karma: 30
looking at /administrator/components/my_component/tables/my_table.php, i see :
if ($XXX === null)
{
JError::raiseWarning(2011, JText::sprintf("XXXX_VALIDATOR_THIS_DATE_DOESN_T_EXISTS_IN_THE_CALENDAR", JText::_("XXX_FIELD_XXX")));

$valid = false;
So i guess that's where it happens... Now let's see what i can do about it...
The administrator has disabled public write access.

Re: Date format - Invalid Value on Null 26 Jun 2012 11:19 #2675

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Fixed.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: VeCrea

Re: Date format - Invalid Value on Null 26 Jun 2012 19:32 #2688

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
  • Karma: 30
Thanks
The administrator has disabled public write access.
Time to create page: 0.061 seconds

Get Started