? Success

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
22 Sep 2016

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.

Before patch:
screen shot 2016-09-22 at 11 14 25

After patch
screen shot 2016-09-22 at 11 01 55

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.

avatar infograf768 infograf768 - open - 22 Sep 2016
avatar infograf768 infograf768 - change - 22 Sep 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 Sep 2016
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 22 Sep 2016
Category Administration Components
avatar infograf768 infograf768 - change - 22 Sep 2016
The description was changed
avatar infograf768 infograf768 - edited - 22 Sep 2016
avatar amir-armaghan
amir-armaghan - comment - 23 Sep 2016

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.

avatar infograf768 infograf768 - alter_testresult - 23 Sep 2016 - mir-armaghan: Tested successfully
avatar infograf768
infograf768 - comment - 23 Sep 2016

I consider your test OK. Thanks.

avatar Bakual
Bakual - comment - 23 Sep 2016

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. ?

avatar infograf768
infograf768 - comment - 23 Sep 2016

What do you think?

very good idea. I was expecting you to help here. ?
will do

avatar infograf768
infograf768 - comment - 23 Sep 2016

Done.

avatar infograf768 infograf768 - alter_testresult - 23 Sep 2016 - amir-armaghan: Tested successfully
avatar dgt41 dgt41 - test_item - 23 Sep 2016 - Tested successfully
avatar dgt41
dgt41 - comment - 23 Sep 2016

I have tested this item successfully on af98de1


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/12138.

avatar dgt41 dgt41 - change - 23 Sep 2016
Status Pending Ready to Commit
avatar dgt41
dgt41 - comment - 23 Sep 2016

@infograf768 one space in the foreach: foreach (...)

avatar joomla-cms-bot joomla-cms-bot - change - 23 Sep 2016
Labels Added: ?
avatar zero-24
zero-24 - comment - 23 Sep 2016

@dgt41 @infograf768 i have just fixed the CS errors with the last 2 commits.

avatar infograf768
infograf768 - comment - 23 Sep 2016

Tks folks.

avatar rdeutz rdeutz - close - 23 Sep 2016
avatar rdeutz rdeutz - merge - 23 Sep 2016
avatar joomla-cms-bot joomla-cms-bot - close - 23 Sep 2016
avatar rdeutz rdeutz - change - 23 Sep 2016
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
avatar joomla-cms-bot joomla-cms-bot - change - 23 Sep 2016
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment