set format in date field to yyyy-mm-dd

This commit is contained in:
Uwe Steinmann 2015-10-30 08:02:57 +01:00
parent 74a248d592
commit 15b1414d6e
15 changed files with 41 additions and 41 deletions

View File

@ -123,7 +123,7 @@ $expires = false;
if (!isset($_POST['expires']) || $_POST["expires"] != "false") {
if($_POST["expdate"]) {
$tmp = explode('-', $_POST["expdate"]);
$expires = mktime(0,0,0, $tmp[1], $tmp[0], $tmp[2]);
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]);
} else {
$expires = mktime(0,0,0, $_POST["expmonth"], $_POST["expday"], $_POST["expyear"]);
}

View File

@ -48,13 +48,13 @@ $name = $_POST["name"];
$comment = $_POST["comment"];
if(isset($_POST["from"])) {
$tmp = explode('-', $_POST["from"]);
$from = mktime(0,0,0, $tmp[1], $tmp[0], $tmp[2]);
$from = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]);
} else {
$from = mktime(0,0,0, intval($_POST["frommonth"]), intval($_POST["fromday"]), intval($_POST["fromyear"]));
}
if(isset($_POST["to"])) {
$tmp = explode('-', $_POST["to"]);
$to = mktime(23,59,59, $tmp[1], $tmp[0], $tmp[2]);
$to = mktime(23,59,59, $tmp[1], $tmp[2], $tmp[0]);
} else {
$to = mktime(23,59,59, intval($_POST["tomonth"]), intval($_POST["today"]), intval($_POST["toyear"]));
}

View File

@ -181,7 +181,7 @@ $expires = false;
if (!isset($_POST["expires"]) || $_POST["expires"] != "false") {
if(isset($_POST["expdate"]) && $_POST["expdate"]) {
$tmp = explode('-', $_POST["expdate"]);
$expires = mktime(0,0,0, $tmp[1], $tmp[0], $tmp[2]);
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]);
} else {
$expires = mktime(0,0,0, $_POST["expmonth"], $_POST["expday"], $_POST["expyear"]);
}

View File

@ -57,13 +57,13 @@ $name = $_POST["name"];
$comment = $_POST["comment"];
if(isset($_POST["from"])) {
$tmp = explode('-', $_POST["from"]);
$from = mktime(0,0,0, $tmp[1], $tmp[0], $tmp[2]);
$from = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]);
} else {
$from = mktime(0,0,0, intval($_POST["frommonth"]), intval($_POST["fromday"]), intval($_POST["fromyear"]));
}
if(isset($_POST["to"])) {
$tmp = explode('-', $_POST["to"]);
$to = mktime(23,59,59, $tmp[1], $tmp[0], $tmp[2]);
$to = mktime(23,59,59, $tmp[1], $tmp[2], $tmp[0]);
} else {
$to = mktime(23,59,59, intval($_POST["tomonth"]), intval($_POST["today"]), intval($_POST["toyear"]));
}

View File

@ -241,7 +241,7 @@ if(isset($_GET["fullsearch"]) && $_GET["fullsearch"]) {
if(isset($_GET["createstart"])) {
$tmp = explode("-", $_GET["createstart"]);
$startdate = array('year'=>(int)$tmp[2], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[0], 'hour'=>0, 'minute'=>0, 'second'=>0);
$startdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>0, 'minute'=>0, 'second'=>0);
} else {
if(isset($_GET["createstartyear"]))
$startdate = array('year'=>$_GET["createstartyear"], 'month'=>$_GET["createstartmonth"], 'day'=>$_GET["createstartday"], 'hour'=>0, 'minute'=>0, 'second'=>0);
@ -254,7 +254,7 @@ if(isset($_GET["fullsearch"]) && $_GET["fullsearch"]) {
}
if(isset($_GET["createend"])) {
$tmp = explode("-", $_GET["createend"]);
$stopdate = array('year'=>(int)$tmp[2], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[0], 'hour'=>23, 'minute'=>59, 'second'=>59);
$stopdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>23, 'minute'=>59, 'second'=>59);
} else {
if(isset($_GET["createendyear"]))
$stopdate = array('year'=>$_GET["createendyear"], 'month'=>$_GET["createendmonth"], 'day'=>$_GET["createendday"], 'hour'=>23, 'minute'=>59, 'second'=>59);

View File

@ -45,7 +45,7 @@ $expires = false;
if (!isset($_POST["expires"]) || $_POST["expires"] != "false") {
if(isset($_POST["expdate"]) && $_POST["expdate"]) {
$tmp = explode('-', $_POST["expdate"]);
$expires = mktime(0,0,0, $tmp[1], $tmp[0], $tmp[2]);
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]);
} else {
$expires = mktime(0,0,0, $_POST["expmonth"], $_POST["expday"], $_POST["expyear"]);
}

View File

@ -276,7 +276,7 @@ if ($_FILES['userfile']['error'] == 0) {
if (!isset($_POST['expires']) || $_POST["expires"] != "false") {
if($_POST["expdate"]) {
$tmp = explode('-', $_POST["expdate"]);
$expires = mktime(0,0,0, $tmp[1], $tmp[0], $tmp[2]);
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]);
} else {
$expires = mktime(0,0,0, $_POST["expmonth"], $_POST["expday"], $_POST["expyear"]);
}

View File

@ -167,8 +167,8 @@ $(document).ready(function() {
<tr>
<td><?php printMLText("expires");?>:</td>
<td>
<span class="input-append date span12" id="expirationdate" data-date="<?php echo date('d-m-Y', $expts); ?>" data-date-format="dd-mm-yyyy" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span3" size="16" name="expdate" type="text" value="<?php echo date('d-m-Y', $expts); ?>">
<span class="input-append date span12" id="expirationdate" data-date="<?php echo date('Y-m-d', $expts); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span3" size="16" name="expdate" type="text" value="<?php echo date('Y-m-d', $expts); ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span>&nbsp;
<label class="checkbox inline">

View File

@ -41,7 +41,7 @@ class SeedDMS_View_AddEvent extends SeedDMS_Bootstrap_Style {
$this->contentHeading(getMLText("add_event"));
$this->contentContainerStart();
$expdate = date('d-m-Y');
$expdate = date('Y-m-d');
?>
<script language="JavaScript">
function checkForm()
@ -76,7 +76,7 @@ function checkForm()
<tr>
<td><?php printMLText("from");?>:</td>
<td><?php //$this->printDateChooser(-1, "from");?>
<span class="input-append date span12" id="fromdate" data-date="<?php echo $expdate; ?>" data-date-format="dd-mm-yyyy">
<span class="input-append date span12" id="fromdate" data-date="<?php echo $expdate; ?>" data-date-format="yyyy-mm-dd">
<input class="span6" size="16" name="from" type="text" value="<?php echo $expdate; ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span>
@ -85,7 +85,7 @@ function checkForm()
<tr>
<td><?php printMLText("to");?>:</td>
<td><?php //$this->printDateChooser(-1, "to");?>
<span class="input-append date span12" id="todate" data-date="<?php echo $expdate; ?>" data-date-format="dd-mm-yyyy">
<span class="input-append date span12" id="todate" data-date="<?php echo $expdate; ?>" data-date-format="yyyy-mm-dd">
<input class="span6" size="16" name="to" type="text" value="<?php echo $expdate; ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span>

View File

@ -81,7 +81,7 @@ function checkForm()
$this->contentContainerStart();
if($document->expires())
$expdate = date('d-m-Y', $document->getExpires());
$expdate = date('Y-m-d', $document->getExpires());
else
$expdate = '';
?>
@ -123,7 +123,7 @@ function checkForm()
<tr>
<td><?php printMLText("expires");?>:</td>
<td>
<span class="input-append date span12" id="expirationdate" data-date="<?php echo date('d-m-Y'); ?>" data-date-format="dd-mm-yyyy" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<span class="input-append date span12" id="expirationdate" data-date="<?php echo $expdate; ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span3" size="16" name="expdate" type="text" value="<?php echo $expdate; ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span><br />

View File

@ -82,8 +82,8 @@ function checkForm()
<tr>
<td><?php printMLText("from");?>:</td>
<td><?php //$this->printDateChooser($event["start"], "from");?>
<span class="input-append date span12" id="fromdate" data-date="<?php echo date('d-m-Y', $event["start"]); ?>" data-date-format="dd-mm-yyyy">
<input class="span6" size="16" name="from" type="text" value="<?php echo date('d-m-Y', $event["start"]); ?>">
<span class="input-append date span12" id="fromdate" data-date="<?php echo date('Y-m-d', $event["start"]); ?>" data-date-format="yyyy-mm-dd">
<input class="span6" size="16" name="from" type="text" value="<?php echo date('Y-m-d', $event["start"]); ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span>
</td>
@ -91,8 +91,8 @@ function checkForm()
<tr>
<td><?php printMLText("to");?>:</td>
<td><?php //$this->printDateChooser($event["stop"], "to");?>
<span class="input-append date span12" id="todate" data-date="<?php echo date('d-m-Y', $event["stop"]); ?>" data-date-format="dd-mm-yyyy">
<input class="span6" size="16" name="to" type="text" value="<?php echo date('d-m-Y', $event["stop"]); ?>">
<span class="input-append date span12" id="todate" data-date="<?php echo date('Y-m-d', $event["stop"]); ?>" data-date-format="yyyy-mm-dd">
<input class="span6" size="16" name="to" type="text" value="<?php echo date('Y-m-d', $event["stop"]); ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span>
</td>

View File

@ -162,13 +162,13 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
<label class="checkbox inline">
<input type="checkbox" name="creationdate" value="true" <?php if($creationdate) echo "checked"; ?>/><?php printMLText("between");?>
</label><br />
<span class="input-append date" style="display: inline;" id="createstartdate" data-date="<?php echo date('d-m-Y'); ?>" data-date-format="dd-mm-yyyy" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span4" size="16" name="createstart" type="text" value="<?php if($startdate) printf("%02d-%02d-%04d", $startdate['day'], $startdate['month'], $startdate['year']); else echo date('d-m-Y'); ?>">
<span class="input-append date" style="display: inline;" id="createstartdate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span4" size="16" name="createstart" type="text" value="<?php if($startdate) printf("%04d-%02d-%02d", $startdate['year'], $startdate['month'], $startdate['day']); else echo date('Y-m-d'); ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span>&nbsp;
<?php printMLText("and"); ?>
<span class="input-append date" style="display: inline;" id="createenddate" data-date="<?php echo date('d-m-Y'); ?>" data-date-format="dd-mm-yyyy" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span4" size="16" name="createend" type="text" value="<?php if($stopdate) printf("%02d-%02d-%04d", $stopdate['day'], $stopdate['month'], $stopdate['year']); else echo date('d-m-Y'); ?>">
<span class="input-append date" style="display: inline;" id="createenddate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span4" size="16" name="createend" type="text" value="<?php if($stopdate) printf("%04d-%02d-%02d", $stopdate['year'], $stopdate['month'], $stopdate['day']); else echo date('Y-m-d'); ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span>
</td>
@ -271,13 +271,13 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
<label class="checkbox inline">
<input type="checkbox" name="expirationdate" value="true" <?php if($expirationdate) echo "checked"; ?>/><?php printMLText("between");?>
</label><br />
<span class="input-append date" style="display: inline;" id="expirationstartdate" data-date="<?php echo date('d-m-Y'); ?>" data-date-format="dd-mm-yyyy" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span4" size="16" name="expirationstart" type="text" value="<?php if($expstartdate) printf("%02d-%02d-%04d", $expstartdate['day'], $expstartdate['month'], $expstartdate['year']); else echo date('d-m-Y'); ?>">
<span class="input-append date" style="display: inline;" id="expirationstartdate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span4" size="16" name="expirationstart" type="text" value="<?php if($expstartdate) printf("%04d-%02d-%02d", $expstartdate['year'], $expstartdate['month'], $expstartdate['day']); else echo date('Y-m-d'); ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span>&nbsp;
<?php printMLText("and"); ?>
<span class="input-append date" style="display: inline;" id="expirationenddate" data-date="<?php echo date('d-m-Y'); ?>" data-date-format="dd-mm-yyyy" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span4" size="16" name="expirationend" type="text" value="<?php if($expstopdate) printf("%02d-%02d-%04d", $expstopdate['day'], $expstopdate['month'], $expstopdate['year']); else echo date('d-m-Y'); ?>">
<span class="input-append date" style="display: inline;" id="expirationenddate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span4" size="16" name="expirationend" type="text" value="<?php if($expstopdate) printf("%04d-%02d-%02d", $expstopdate['year'], $expstopdate['month'], $expstopdate['day']); else echo date('Y-m-d'); ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span>
</td>

View File

@ -168,13 +168,13 @@ function checkForm()
<label class="checkbox inline">
<input type="checkbox" name="creationdate" value="true" /><?php printMLText("between");?><br>
</label>
<span class="input-append date" id="createstartdate" data-date="<?php echo date('d-m-Y'); ?>" data-date-format="dd-mm-yyyy" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span3" size="16" name="createstart" type="text" value="<?php echo date('d-m-Y'); ?>">
<span class="input-append date" id="createstartdate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span3" size="16" name="createstart" type="text" value="<?php echo date('Y-m-d'); ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span>&nbsp;
<?php printMLText("and"); ?>
<span class="input-append date" id="createenddate" data-date="<?php echo date('d-m-Y'); ?>" data-date-format="dd-mm-yyyy" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span3" size="16" name="createend" type="text" value="<?php echo date('d-m-Y'); ?>">
<span class="input-append date" id="createenddate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span3" size="16" name="createend" type="text" value="<?php echo date('Y-m-d'); ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span>
</td>
@ -185,13 +185,13 @@ function checkForm()
<label class="checkbox inline">
<input type="checkbox" name="expirationdate" value="true" /><?php printMLText("between");?><br>
</label>
<span class="input-append date" id="expirationstartdate" data-date="<?php echo date('d-m-Y'); ?>" data-date-format="dd-mm-yyyy" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span3" size="16" name="expirationstart" type="text" value="<?php echo date('d-m-Y'); ?>">
<span class="input-append date" id="expirationstartdate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span3" size="16" name="expirationstart" type="text" value="<?php echo date('Y-m-d'); ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span>&nbsp;
<?php printMLText("and"); ?>
<span class="input-append date" id="expirationenddate" data-date="<?php echo date('d-m-Y'); ?>" data-date-format="dd-mm-yyyy" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span3" size="16" name="expirationend" type="text" value="<?php echo date('d-m-Y'); ?>">
<span class="input-append date" id="expirationenddate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span3" size="16" name="expirationend" type="text" value="<?php echo date('Y-m-d'); ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span>
</td>

View File

@ -45,7 +45,7 @@ class SeedDMS_View_SetExpires extends SeedDMS_Bootstrap_Style {
$this->contentContainerStart();
if($document->expires())
$expdate = date('d-m-Y', $document->getExpires());
$expdate = date('Y-m-d', $document->getExpires());
else
$expdate = '';
?>
@ -57,7 +57,7 @@ class SeedDMS_View_SetExpires extends SeedDMS_Bootstrap_Style {
<tr>
<td><?php printMLText("expires");?>:</td>
<td>
<span class="input-append date span12" id="expirationdate" data-date="<?php echo $expdate; ?>" data-date-format="dd-mm-yyyy" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<span class="input-append date span12" id="expirationdate" data-date="<?php echo $expdate; ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span6" name="expdate" type="text" value="<?php echo $expdate; ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span><br />

View File

@ -183,8 +183,8 @@ function checkForm()
<tr>
<td><?php printMLText("expires");?>:</td>
<td class="standardText">
<span class="input-append date span12" id="expirationdate" data-date="<?php echo date('d-m-Y', $expts); ?>" data-date-format="dd-mm-yyyy" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span3" size="16" name="expdate" type="text" value="<?php echo date('d-m-Y', $expts); ?>">
<span class="input-append date span12" id="expirationdate" data-date="<?php echo date('Y-m-d', $expts); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span3" size="16" name="expdate" type="text" value="<?php echo date('Y-m-d', $expts); ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</span><br />
<label class="checkbox inline">