JDateTime extension is a convenient and complete solution for users who want to use jalali date in their projects.
Requirements ¶
Yii 1.1 or above
Install ¶
- Extract to extensions directory
- Add as component to main config
'jdate' => array(
'class' => 'ext.jdate.JDateTime',
'convert' => true,
'jalali' => true,
'timezone' => 'Asia/Tehran',
),
Usage ¶
Yii::app()->jdate->date("H:i:s Y/m/d",time())
Farsi font is wrong.
Hi,
Near 369 line:
$farsi_array = array("?", "?", "?", "?", "?", "?", "?", "?", "?", "?");
Farsi font is wrong.
This must to be corrected.
Thanks
Nabi
font was not wrong
sorry users!
there was an error in file encoding and in the new version file encoding problems solved please update your extention
problem
hey
I have a problem with version 0.1
Fatal error: Call to undefined method JDateTime::init() in ...\framework\base\CModule.php on line 388
Fatal error: Call to undefined method JDateTime::init()
new version has been just released fatal error fixed in new version
any documentation?
is function
Yii::app()->jdate->date("H:i:s Y/m/d",time());
accept only time() (timestamps)? is there any integration rule for models?refer to mohamadaliakbari
hi mohamad.
please feel free to ask any kind of question do you have about this extension there is no any document available for this simple extension although I don't think you need more explanation to use. it's quite straightforward.
function "Yii::app()->jdate->date()" do similar php date function and you can use it just as date() function but the role of this extension is not about i18n or bla bla bla.
if you need and Jalali date validation in your model please read yii core validator class and make it and if it's possible for you share it with other! this is the only way to say thank you to me or any one who share their works/time/experience for you :)
some features
Hi,
is there any reverse method to convert Jalali to Gregorian? I'm currently work on integrating jalalidatepicker with this module and provide integration with yii AR models.
so I should provide afterFind and beforeSave and validation rules methods.
now let me know if your extension let me convert Jalali to Gregorian to save all dates in standard mySql DATE type in beforeSave method...
convert
as I said before this extension simulate date function for jalali date so there is no any reverse method to convert jalali to Gregorian.
your effort to support jalali date in model validations is totally welcomed ;)
thanks a lot...
a bug and a suggestion
Hi dear Ramin,
Thanks for great extension.
Would do I know what's "امرداد" ?!!! (on line 455) :-D
And also, I suggest to change some functions from private to public about functions like getDayNames(), getMonthNames(), and maybe more functions, and maybe convertNumbers(). because for example getMonthNames() many used in generate dropDownList to show all months, and maybe others be like this functions having benefit for public used.
Thanks
just show now
Hi.
I save the time in my database in DateTime format. when i use:
echo Yii::app()->jdate->date('Y-m-d H:i:s',strtotime($model->creatino_time));
it just show no time in jalali, but in this case:
echo date('Y-m-d H:i:s',$model->creatino_time);
it do the right.
By the way, Is there any git repository to fork on it?
just show now
Hi Shahcheraghean
there is no any git repo yet because there is no any update for it until next issue report!
thanks for using this extnsion and if I find any free time in the future I will release a bunch of component on github under GPL license so you guys can use them freely may be this happend after next major Yii framework.
just show now
Dear Mr. Ramin Farmani. Thank's for your extension and your idea about putting it on the git.
what about my first part of the question?
thanks
big like ;)
so good
Thanks.MR Ramini
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.