mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-10-20 15:24:35 -04:00
manage better meridiem cases with datetimepicker (use strpos) (#116)
This commit is contained in:
1 parent
ab87b30423
commit
cf92544600
2 files changed
+48
-40
No files matched your search
@@ -159,20 +159,24 @@ $(document).ready(function()
|
||||
"<?php echo $this->lang->line("common_monthsshort_december"); ?>"],
|
||||
today: "<?php echo $this->lang->line("common_today"); ?>",
|
||||
<?php
|
||||
$t = $this->config->item('timeformat');
|
||||
$m = $t[strlen($t)-1];
|
||||
if( $m == 'a')
|
||||
{
|
||||
if( strpos($this->config->item('timeformat'), 'a') !== false )
|
||||
{
|
||||
?>
|
||||
meridiem: ["am", "pm"],
|
||||
meridiem: ["am", "pm"],
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else if( strpos($this->config->item('timeformat'), 'A') !== false )
|
||||
{
|
||||
?>
|
||||
meridiem: ["AM", "PM"],
|
||||
meridiem: ["AM", "PM"],
|
||||
<?php
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
meridiem: [],
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
weekStart: <?php echo $this->lang->line("common_weekstart"); ?>,
|
||||
};
|
||||
@@ -181,20 +185,20 @@ $(document).ready(function()
|
||||
format: "<?php echo dateformat_bootstrap($this->config->item("dateformat")) . ' ' . dateformat_bootstrap($this->config->item("timeformat"));?>",
|
||||
startDate: "<?php echo date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), mktime(0, 0, 0, 1, 1, 2010));?>",
|
||||
<?php
|
||||
$t = $this->config->item('timeformat');
|
||||
$m = $t[strlen($t)-1];
|
||||
if( $m == 'a' || $m == 'A' )
|
||||
{
|
||||
$t = $this->config->item('timeformat');
|
||||
$m = $t[strlen($t)-1];
|
||||
if( strpos($this->config->item('timeformat'), 'a') !== false || strpos($this->config->item('timeformat'), 'A') !== false )
|
||||
{
|
||||
?>
|
||||
showMeridian: true,
|
||||
showMeridian: true,
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
showMeridian: false,
|
||||
showMeridian: false,
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
minuteStep: 1,
|
||||
autoclose: true,
|
||||
|
||||
@@ -102,20 +102,24 @@ $(document).ready(function()
|
||||
"<?php echo $this->lang->line("common_monthsshort_december"); ?>"],
|
||||
today: "<?php echo $this->lang->line("common_today"); ?>",
|
||||
<?php
|
||||
$t = $this->config->item('timeformat');
|
||||
$m = $t[strlen($t)-1];
|
||||
if( $m == 'a')
|
||||
{
|
||||
if( strpos($this->config->item('timeformat'), 'a') !== false )
|
||||
{
|
||||
?>
|
||||
meridiem: ["am", "pm"],
|
||||
meridiem: ["am", "pm"],
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else if( strpos($this->config->item('timeformat'), 'A') !== false )
|
||||
{
|
||||
?>
|
||||
meridiem: ["AM", "PM"],
|
||||
meridiem: ["AM", "PM"],
|
||||
<?php
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
meridiem: [],
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
weekStart: <?php echo $this->lang->line("common_weekstart"); ?>
|
||||
};
|
||||
@@ -125,20 +129,20 @@ $(document).ready(function()
|
||||
format: "<?php echo dateformat_bootstrap($this->config->item("dateformat")) . ' ' . dateformat_bootstrap($this->config->item("timeformat"));?>",
|
||||
startDate: "<?php echo date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), mktime(0, 0, 0, 1, 1, 2010));?>",
|
||||
<?php
|
||||
$t = $this->config->item('timeformat');
|
||||
$m = $t[strlen($t)-1];
|
||||
if( $m == 'a' || $m == 'A' )
|
||||
{
|
||||
$t = $this->config->item('timeformat');
|
||||
$m = $t[strlen($t)-1];
|
||||
if( strpos($this->config->item('timeformat'), 'a') !== false || strpos($this->config->item('timeformat'), 'A') !== false )
|
||||
{
|
||||
?>
|
||||
showMeridian: true,
|
||||
showMeridian: true,
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
showMeridian: false,
|
||||
showMeridian: false,
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
autoclose: true,
|
||||
todayBtn: true,
|
||||
|
||||
Reference in new issue
Block a user