User tests: Successful: Unsuccessful:
Testing instructions:
Install the fa-IR persian language pack.
Edit an article (or a category, or a newsfeed, etc.
Click on the Versions toolbar button.
Note: the order of the date in the title, although now correctly set to Jalali is not in the same order as the other date fields below. These last ones are the same as in the Manager and in the Publishing tab date fields. This is independant from this PR
This could be solved by checkingif the language is RTL and change the order of Ymd in the models.
Instead of
$object->save_date = JHtml::_('date', $table->save_date, 'Y-m-d H:i:s');
we could use
$object->save_date = JHtml::_('date', $table->save_date, 'd-m-Y H:i:s');
As I am not sure this would fit for all RTL languages, I did not do it.
Therefore, this is already much better imho as we do get the Jalali date.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Category | ⇒ | Administration Components |
I consider your test OK. Thanks.
Instead of adding the same code for each property, I would use something like this:
$dateProperties = array (
'modified_time',
'created_time',
'modified',
'created',
'checked_out_time',
'publish_up',
'publish_down',
);
foreach($dateProperties as $dateProperty)
{
if (array_key_exists($dateProperty, $object->data) && $object->data->$dateProperty->value != '0000-00-00 00:00:00')
{
$object->data->$dateProperty->value = JHtml::_('date', $object->data->$dateProperty->value, 'Y-m-d H:i:s');
}
}
What do you think?
The hardcoding of the properties is obviously not a good thing, but I don't think we have a way of detecting the type of the field in this case, so I'd go with this approach.
What do you think?
very good idea. I was expecting you to help here.
will do
Done.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
@infograf768 one space in the foreach: foreach (...)
Labels |
Added:
?
|
@dgt41 @infograf768 i have just fixed the CS errors with the last 2 commits.
Tks folks.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-09-23 18:36:05 |
Closed_By | ⇒ | rdeutz |
Labels |
Removed:
?
|
I can confirm that the issue exists before applying the patch.
And the current date order is right for Jalali. Jalali dates are like: Y/M/D.