mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
add support for using configured date format
This commit is contained in:
parent
88f3205be7
commit
efe6fe085d
|
@ -49,8 +49,9 @@ if (!isset($_POST["presetexpdate"]) || $_POST["presetexpdate"] == "") {
|
|||
|
||||
switch($_POST["presetexpdate"]) {
|
||||
case "date":
|
||||
$tmp = explode('-', $_POST["expdate"]);
|
||||
$expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]);
|
||||
$expires = strtotime($_POST["expdate"]);
|
||||
// $tmp = explode('-', $_POST["expdate"]);
|
||||
// $expires = mktime(0,0,0, $tmp[1], $tmp[2], $tmp[0]);
|
||||
break;
|
||||
case "1w":
|
||||
$tmp = explode('-', date('Y-m-d'));
|
||||
|
@ -88,6 +89,11 @@ if(isset($GLOBALS['SEEDDMS_HOOKS']['setExpires'])) {
|
|||
|
||||
if (!$document->setExpires($expires)){
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
|
||||
} else {
|
||||
if($expires)
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_expiration_date_set', array('date'=>getReadableDate($expires)))));
|
||||
else
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_expiration_date_cleared')));
|
||||
}
|
||||
|
||||
$document->verifyLastestContentExpriry();
|
||||
|
|
|
@ -63,7 +63,7 @@ $(document).ready( function() {
|
|||
|
||||
$('body').on('touchstart.dropdown', '.dropdown-menu', function (e) { e.stopPropagation(); });
|
||||
|
||||
$('.datepicker, #expirationdate, #fromdate, #todate, #createstartdate, #createenddate, #expirationstartdate, #expirationenddate')
|
||||
$('.datepicker, #expirationdate, #createstartdate, #createenddate, #expirationstartdate, #expirationenddate')
|
||||
.datepicker({todayHighlight: true, toggleActive: true})
|
||||
.on('changeDate', function(ev){
|
||||
if(ev.date && $(ev.target).data('selectmenu')) {
|
||||
|
|
|
@ -59,7 +59,7 @@ $(document).ready( function() {
|
|||
$this->contentContainerStart();
|
||||
|
||||
if($document->expires())
|
||||
$expdate = date('Y-m-d', $document->getExpires());
|
||||
$expdate = getReadableDate($document->getExpires());
|
||||
else
|
||||
$expdate = '';
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue
Block a user