Merge pull request #2668 from opensourcepos/fix-attr-default-date

Use today as default date in DATETIME attribute (#2666)
This commit is contained in:
FrancescoUK
2020-01-12 22:13:59 +00:00
committed by GitHub
3 changed files with 2 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
const DEFAULT_LANGUAGE = 'english';
const DEFAULT_LANGUAGE_CODE = 'en-US';
define('NOW', time());
define('DEFAULT_DATE', mktime(0, 0, 0, 1, 1, 2010));
define('DEFAULT_DATETIME', mktime(0, 0, 0, 1, 1, 2010));

View File

@@ -24,7 +24,7 @@ foreach($definition_values as $definition_id => $definition_value)
if ($definition_value['definition_type'] == DATE)
{
$value = (empty($attribute_value) || empty($attribute_value->attribute_date)) ? DEFAULT_DATE : strtotime($attribute_value->attribute_date);
$value = (empty($attribute_value) || empty($attribute_value->attribute_date)) ? NOW : strtotime($attribute_value->attribute_date);
echo form_input(array(
'name' => "attribute_links[$definition_id]",
'value' => to_date($value),

View File

@@ -3,7 +3,6 @@
var pickerconfig = function(config) {
return $.extend({
format: "<?php echo dateformat_bootstrap($this->config->item('dateformat')) . ' ' . dateformat_bootstrap($this->config->item('timeformat'));?>",
startDate: "<?php echo to_date(); ?>",
<?php
$t = $this->config->item('timeformat');
$m = $t[strlen($t)-1];