We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Date validator | Forum

Mohammad
Mohammad Dec 9 '13
Hello

I've changed Gregorian date to Jalali date(I still want to save it in Gregorian) but I can't submit form since it say"Date validator error!" ,then I searched files for date validator function and found this :

public static function isDateValid( $month, $day, $year )  

  {      

  if ( !checkdate($month, $day, $year) )   

     {      

      return false;     

   }
        return true;  

  }

but didn't help

so here's my question

when someone edit his/her birthday in profile edit(~profile/edit) where data go for validating ?

update: I found this but I couldn't understand anything

if ( empty($errorMessage) )

        {

            $errorMessage = 'Date Validator Error!';

        }

update2: also I found this,but it wouldn't help either

private function setDefaultDate( $year, $month, $day )

    {

        if ( UTIL_Validator::isDateValid((int) $month, (int) $day, (int) $year) )

        {

            $this->defaultDate['year'] = (int) $year;

            $this->defaultDate['month'] = (int) $month;

            $this->defaultDate['day'] = (int) $day;

           

        }

        else

        {

            throw new InvalidArgumentException('Invalid date!');

        }

Thank you

The Forum post is edited by Mohammad Dec 11 '13
Mohammad
Mohammad Dec 13 '13
after 5 days without reply, I tried  once more to solve my problem and I did it!