Closed mdaliyan closed 7 years ago
Surely, this needs refactoring, but it works so far.
I'll add missing modification options later.
Thanks from PR, But your commits changes jDate
functionality. If anyone uses jdate()
or jDate::forge()
then can't to use modify
method. jDate
class is just for displaying gregorian datetime in jalai format and not about parsing jalali data & time.
Please create another class for parsing jalai date and make a PR on develop
branch.
I'm afraid, it's not true. reforge
and forge
functions still work with gregorian dates, and modify
function did't exist in jDate before this. so nothing breaking will accure. All tests are green.
besides, the person who uses modify
, more likely uses format
along side. why should we separate them? Likewise, both of them exist beside each other in datetime
class.
A class with multiple functionality? some time with gregorian and some times with jalali?
The right solution is a jalali implementation of DateTime
or Carbon
classes.
A class with multiple functionality? some time with gregorian and some times with jalali?
Exactly.
The right solution is a jalali implementation of DateTime or Carbon classes.
I'm working on it. But I was planning to use morilog/jalali
as backbone.
BTW multiple functionality for jDate is not acceptable
This PR is created to add Jalali-base modify function to jDate
Not all modifications are available but it is usable and fully tested this far. These are some examples of features that are added to jDate: