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

join birthday validator | Forum

Jeroen
Jeroen Apr 1 '14
hi i have trouble on the join page

i change the date to europe dd/mm/yyyy


but date validator only works with


mm/dd/yyyy


how to change

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

 {        

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

  {            return false;    

    }
        return true; 

   }

to dd/mm/yyyy


so i cant make it Required


jeroen

The Forum post is edited by Jeroen Apr 1 '14
Alia Team
Alia Apr 1 '14
Jeroen, I have just changed date format to dd/mm/yyyy on my testing environment and validation worked on join form - I was not able to register without filling in required field of "Date" type. Can you explain how I can reproduce your issue?

John
John Apr 1 '14
Jeroen, did you change the date settings via the Admin Panel:

admin/settings/main settings/time settings/date format

select day/month/year

Time Zone your country/state
Use realative Time Tick/untick
Use Military Time Ditto

Finance: Correct currency

Save


Jeroen
Jeroen Apr 1 '14
yes john i dit it.


whats happening is that


when i wanna make date of birth dd/mm/yyyy join form shows all ok


but when i fil in my personal date then ... klick register.


never go further .. says (Required)


never pass the validator.


jeroen

Alia Team
Alia Apr 2 '14
Jeroen, I am still unable to reproduce this. Any chance you can share your site URL?
Jeroen
Jeroen Apr 2 '14
yess i will but when are you online becouse i cant accept joins when i make date of birth requierd


:(

http://www.dreamcommunity.nl


i enable him now 


greets


doomer

Jeroen
Jeroen Apr 4 '14
Aliia


is it posible that the changed date_time.php is modified to


 public static function formatSimpleDate( $timeStamp, $onlyDate = false )

    {


        $militaryTime = (bool) OW::getConfig()->getValue('base', 'military_time');


        $language = OW::getLanguage();


        if ( !$timeStamp )

        {

            return '_INVALID_TS_';

        }


        $month = $language->text('base', 'date_time_month_short_' . date('n', $timeStamp));


        //$at = $language->text('base', 'date_time_at_label');


        if ( $onlyDate )

        {

            return ( date('y', $timeStamp) === date('y', time()) ) ?

                 strftime("%a, %d.%m.%Y", $timeStamp) :

                 strftime("%a, %d.%m.%Y", $timeStamp);

        }


        return ( date('y', $timeStamp) === date('y', time()) ) ?

            ( $militaryTime ? strftime("%a, %d.%m.%Y, %H:%M", $timeStamp) : strftime("%a, %d.%m.%Y, %I:%M%p", $timeStamp) ) :

            ( $militaryTime ? strftime("%a, %d.%m.%y, %H:%M", $timeStamp) : strftime("%a, %d.%m.%Y, %I:%M%p", $timeStamp) );

    }

    /*     * p, $onlyDate = null )

     * Returns formated date string/literal date string for provided time stamp.

     *

     * Format:

     *          `{literal|str}`

     *          `{literal|str} {hours:int}:{minutes:int}[am/pm]`

     *          `{month:str} {day:int} '{year:int} {hours:int}:{minutes:int}[am/pm]`

     *

     * Samples:

     *          `within 1 minute`

     *          `within 3 minutes`

     *          `1 hour ago`

     *          `5 hours ago`

     *          `today` | $onlyDate = true

     *          `yesterday, 15:48[am/pm]`

     *          `yesterday` | $onlyDate = true

     *          `Jan 17 '09, 11:07[am]`

     *          `Oct 25 '09, 08:09[pm]`

     *          `Oct 25 '09` | $onlyDate = true

     *

     * @param integer $timeStamp

     * @param boolean $onlyDate

     * @return string

     */


the problems makes


greets 

Jeroen

The Forum post is edited by Jeroen Apr 4 '14
Jeroen
Jeroen Apr 11 '14
find the problem here is my answer


change /ow_utlities/date_time php


      if ( $onlyDate )    

    {            

return ( date('y', $timeStamp) === date('y', time()) ) ?              

   strftime(" %d %b %Y", $timeStamp) :            

   /* %d is dag %b is month jan,feb,mrt   **/


$month . strftime(" %e '%y", $timeStamp);
        }
        return ( date('y', $timeStamp) === date('y', time()) ) ?      

      $month . ( $militaryTime ? strftime(" %e, %H:%M", $timeStamp) : strftime(" %e, %I:%M%p", $timeStamp) ) :  

          $month . ( $militaryTime ? strftime(" %e '%y, %H:%M", $timeStamp) : strftime(" %e '%y, %I:%M%p", $timeStamp) );    

}


works wil all europien locales


this fix join (birthday validator and newsfeed's)

The Forum post is edited by Jeroen Apr 11 '14
Alia Team
Alia Apr 11 '14
Thanks for sharing Jereon.