Commit 75545174 authored by Leigh B Stoller's avatar Leigh B Stoller

Minor change to MaxExtension return structure.

parent a6074bec
......@@ -594,10 +594,10 @@ $(function ()
return;
}
// Save for checking the extension input field.
maxextension = moment(json.value);
maxextension = moment(json.value.maxextension);
$('#max-extension').html(moment(json.value)
.format("MMM D, YYYY h:mm A"));
$('#max-extension')
.html(maxextension.format("MMM D, YYYY h:mm A"));
/*
* Look to see if the number of hours requested is going to be
......@@ -606,7 +606,7 @@ $(function ()
*/
if (window.HOURS) {
var exp = new Date(expires);
var max = new Date(json.value);
var max = new Date(json.value.maxextension);
exp.setTime(exp.getTime() + window.HOURS * 3600 * 1000);
if (exp.getTime() > max.getTime()) {
......
......@@ -556,8 +556,8 @@ window.ShowExtendModal = (function()
(window.APT_OPTIONS.MAXEXTEND*3600*1000));
}
else {
later = new Date(json.value);
maxextend_date = json.value;
later = new Date(json.value.maxextension);
maxextend_date = json.value.maxextension;
}
console.info("Max extension date:", later);
......
......@@ -3242,11 +3242,13 @@ $(function ()
function LoadMaxExtension()
{
var maxcallback = function(json) {
console.info("LoadMaxExtension: ", json);
if (json.code) {
console.info("Failed to get max extension: " + json.value);
return;
}
var maxdate = new Date(json.value);
var maxdate = new Date(json.value.maxextension);
//console.info("Max extension date:", maxdate);
/*
......
......@@ -1739,7 +1739,8 @@ function Do_MaxExtension()
$webtask->Delete();
return;
}
$blob = $webtask->TaskValue("MaxExtension");
$blob = array("maxextension" => $webtask->TaskValue("MaxExtension"),
"reservations" => $webtask->TaskValue("Reservations"));
$webtask->Delete();
SPITAJAX_RESPONSE($blob);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment