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

edit Birthdate [Solution available] | Forum

ma3ih Club
ma3ih Jan 9 '13
hello every one

when some one want to register

or edit his/her profile

he/she see birthday question 

year/month/day


i want edit that field 

and replace with jalali date

wich file i must edit? 

and where that Form posted?

i must edit that file too  for translate to Orginal date/time again for save in database



my project is something like this

1-Get birthday saved in database (orginal)

2-translate to jalali date

3- show Jalali year/month/day to user

4- user edit it and save

5- translate edited jalali date to orginal date and time

6- save orginal date to database again

The Forum post is edited by Alia Jul 1 '14
Michael I.
Michael I. Jan 10 '13
All dates in Oxwall are handled by functions formatSimpleDate and formatDate in /ow_utilities/date_time.php file. That is where you should make changes to make Oxwall work with Jalali calendar.
ma3ih Club
ma3ih Jan 10 '13
thank you  for your helpful answer

i try to figure it out

but please make wiki for developer s


Michael I.
Michael I. Jan 14 '13
We are working on more extended documentation for developers.
Karalius Kraujas
Karalius Kraujas Apr 29 '14
so there i should edit, if i would like in Profile to be displayed full-date (with year)?
Alia Team
Alia May 6 '14
Karalius Kraujas, can you elaborate more on your question? Oxwall displays full year by default on profile view page:


Karalius Kraujas
Karalius Kraujas Jun 29 '14
the topic is about
birthdate
not join date :)
Alia Team
Alia Jul 1 '14
I apologize for the mistake ( have no idea what why I was looking at join date) :D

To display year you will need to edit: ow_utilities/date_time.php

Function to edit: public static function formatBirthdate( $year, $month, $day )

As an example let's take d/m/y format (selected in admin panel>>settings>>main settings).
Original code for this date format is:


if ( $format === 'dmy' )

{

$result = date("d", mktime(0, 0, 0, $month, $day, $year)) . " " .

$language->text('base', 'date_time_month_short_' . (int)$month) ;

}


Modified code:


if ( $format === 'dmy' )
{
$result = date("d", mktime(0, 0, 0, $month, $day, $year)) . " " .

$language->text('base', 'date_time_month_short_' . (int)$month)." ". $year ;
}


Karalius Kraujas
Karalius Kraujas Jul 4 '14
Thank You!