calendar format in non Gregorian countries #135
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#135
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
hello,
i think every calendar fields should use :
<?php echo JHtml::_('date', $this->escape($item->somefield), 'Y/m/d') ; ?>
instead of :
<?php echo $this->escape($item->somefield); ?>
and "Y/m/d" should get from field format :
in admin list view (views->someview->tmpl->default_body)
that's because in some regions the official calendar isn't Gregorian. and that is using default calendar format used in joomla.
for example, the com_content in joomla use this :
<?php $date = $item->{$orderingColumn}; echo $date > 0 ? JHtml::_('date', $date, JText::_('DATE_FORMAT_LC4')) : '-'; ?>
if i can know where default admin list view generated in compiler, i can fix it & if you think this is ok i will fix & pull request for that in github.
best regards.
There is a way to deal with this... let me explain.
The escape of the fields are done by default to all fields... but it can be turned off. This will then allow you to in the model fix the date display to work in any way you would like it to display.
You only add the the xml value:
escape="false";
Then in the model you can do something like this:
The helper class can look something like this:
This way you have full control and the behavior is not hard coded into JCB, let me know if you still think we should change the compiler, or if this will resolve your issue.
thank you very much for your help, yes that's fix the problem.
for anyone have same problem, i add this code & now that's working!
add :
to :
Add PHP (getItems Method - before translation fix & decryption)
result :
(actually that's working without adding
escape="false";
to XML ! )