? Success

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
1 Apr 2019

Summary of Changes

As title says.
Some date fields use text as field type instead of calendar and therefore do not display the date as defined by the language in use.

Testing Instructions

Install French Language. Switch to French in backend
Create, save and save again a Field Group.
Create, save and save again a Field

Before patch

Screen Shot 2019-04-01 at 10 40 40

After patch

Screen Shot 2019-04-01 at 10 49 58

Screen Shot 2019-04-01 at 10 50 53

avatar infograf768 infograf768 - open - 1 Apr 2019
avatar infograf768 infograf768 - change - 1 Apr 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Apr 2019
Category Administration com_fields
avatar infograf768 infograf768 - change - 1 Apr 2019
Labels Added: ?
avatar Bakual
Bakual - comment - 3 Apr 2019

The time formatting works fine, however it applies timezone differences twice now.

You need to also remove the code in FieldModel and GroupModel which converts the timezones as that is done by the formfield now.

// Convert the created and modified dates to local user time for
// display in the form.
$tz = new \DateTimeZone(Factory::getApplication()->get('offset'));
if ((int) $result->created_time)
{
$date = new Date($result->created_time);
$date->setTimezone($tz);
$result->created_time = $date->toSql(true);
}
else
{
$result->created_time = null;
}
if ((int) $result->modified_time)
{
$date = new Date($result->modified_time);
$date->setTimezone($tz);
$result->modified_time = $date->toSql(true);
}
else
{
$result->modified_time = null;
}

and
// Convert the created and modified dates to local user time for display in the form.
$tz = new \DateTimeZone(Factory::getApplication()->get('offset'));
if ((int) $item->created)
{
$date = new Date($item->created);
$date->setTimezone($tz);
$item->created = $date->toSql(true);
}
else
{
$item->created = null;
}
if ((int) $item->modified)
{
$date = new Date($item->modified);
$date->setTimezone($tz);
$item->modified = $date->toSql(true);
}
else
{
$item->modified = null;
}

avatar infograf768
infograf768 - comment - 3 Apr 2019

will do. tks

avatar infograf768
infograf768 - comment - 3 Apr 2019

@Bakual
Done.

avatar infograf768
infograf768 - comment - 3 Apr 2019

Note: we have the same error in 3.9. The time zone is taken care of in the xmls with filter="user_utc" but the models apply the timezone twice.

avatar infograf768
infograf768 - comment - 4 Apr 2019

reverted changes to models as they have first to be done in 3.9 to prevent merge issues.

avatar hardik-codes
hardik-codes - comment - 4 Apr 2019

@infograf768 may I do a PR for 3.9 for reverting changes to models

avatar infograf768
infograf768 - comment - 4 Apr 2019

Already done
#24473

Please test there and here too for translateformat

avatar Bakual
Bakual - comment - 4 Apr 2019

I think this PR can be closed full as the same changes were done in J3.9.4 (#23784) and just need to be merged up into J4.
@wilsonge I think you're not yet at 3.9.4 with your upmerge task, right?

avatar infograf768
infograf768 - comment - 4 Apr 2019

You are right. Closing now.

avatar infograf768 infograf768 - close - 4 Apr 2019
avatar infograf768 infograf768 - change - 4 Apr 2019
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2019-04-04 08:26:20
Closed_By infograf768
avatar wilsonge
wilsonge - comment - 4 Apr 2019

@Bakual Nope. I'm aiming to reach 3.9.0 alpha some time next week

Add a Comment

Login with GitHub to post a comment