mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-21 15:30:29 -04:00
Merge pull request #2668 from opensourcepos/fix-attr-default-date
Use today as default date in DATETIME attribute (#2666)
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user