-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Bug #157673 fix: Add configuration to format date to display * Bug #157673 fix: Add configuration to format date to display. * Bug #157673 fix: Add configuration to format date to display. * Bug #157673 fix: Add configuration to format date to display. * Bug #157673 fix: Add configuration to format date to display. * Bug #157673 fix: Add configuration to format date to display. * Bug #157673 fix: Add configuration to format date to display. * Bug #157673 fix: Add configuration to format date to display. * Bug #157673 fix: Add configuration to format date to display. * Bug #157673 fix: Add configuration to format date to display. * Bug #157673 fix: Add configuration to format date to display. * Bug #157673 fix: Add configuration to format date to display. * Bug #157673 fix: Add configuration to format date to display.
- Loading branch information
1 parent
3d5e634
commit 733c1fe
Showing
12 changed files
with
211 additions
and
92 deletions.
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
src/components/com_tc/administrator/assets/elements/dateformat.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
/** | ||
* @package Tc | ||
* @subpackage com_tc | ||
* | ||
* @author Techjoomla <[email protected]> | ||
* @copyright Copyright (C) 2009 - 2020 Techjoomla. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die('Restricted access'); | ||
use Joomla\CMS\Form\FormField; | ||
use Joomla\CMS\HTML\HTMLHelper; | ||
/** | ||
* JFormFieldDateformat class | ||
* | ||
* @package Tc | ||
* @subpackage component | ||
* @since 1.1 | ||
*/ | ||
class JFormFieldDateformat extends FormField | ||
{ | ||
/** | ||
* The form field type. | ||
* | ||
* @var string | ||
* @since 1.1 | ||
*/ | ||
protected $type = 'dateformat'; | ||
|
||
/** | ||
* Fiedd to decide if options are being loaded externally and from xml | ||
* | ||
* @var integer | ||
* @since 1.1 | ||
*/ | ||
|
||
/** | ||
* Method to get the field input markup. | ||
* | ||
* @since 1.1 | ||
* | ||
* @return array The field input markup | ||
*/ | ||
public function getInput () | ||
{ | ||
return $this->fetchElement($this->name, $this->value, $this->element, $this->options['controls']); | ||
} | ||
|
||
/** | ||
* Method fetchElement | ||
* | ||
* @param string $name name of element | ||
* @param string $value value of element | ||
* @param string &$node node | ||
* @param string $control_name control name | ||
* | ||
* @return array date format list | ||
* | ||
* @since 1.1 | ||
*/ | ||
public function fetchElement ($name, $value, &$node, $control_name) | ||
{ | ||
$sqlGmtTimestamp = "2012-01-01 20:00:00"; | ||
|
||
$dateFormat = array("Y-m-d H:i:s", "D, M d h:i A", "F j, Y, g:i a", "m.d.y", "j, n, Y", "h-i-s, j-m-y", "H:i:s"); | ||
|
||
foreach ($dateFormat as $date) | ||
{ | ||
$options[] = HTMLHelper::_('select.option', $date, HTMLHelper::date($sqlGmtTimestamp, $date, true)); | ||
} | ||
|
||
$options[] = HTMLHelper::_('select.option', 'custom', JText::_('COM_TC_DATE_FORMAT_CUSTOM')); | ||
|
||
return HTMLHelper::_('select.genericlist', $options, $name, 'class="inputbox" ', 'value', 'text', $value, $control_name . $name); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<config> | ||
|
||
</config> | ||
|
||
<fieldset name="integration_settings" label="COM_TC_BASIC_CONFIG_SET" description="" addfieldpath="/administrator/components/com_tc/assets/elements"> | ||
<field name="date_format_show" type="dateformat" label="COM_TC_DATE_FORMAT_TO_SHOW" description="COM_TC_DATE_FORMAT_TO_SHOW_DESC" /> | ||
<field name="custom_format" class="inputbox" type="text" label="COM_TC_CUSTOM_DATE_FORMAT" showon="date_format_show:custom" description="COM_TC_CUSTOM_DATE_FORMAT_DESC" /> | ||
</fieldset> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.