filter dialog: display parsed date when checking; fix Check it button not using Dijit control

This commit is contained in:
Andrew Dolgov 2011-04-18 13:09:59 +04:00
parent 361840203b
commit aaba22250f
3 changed files with 5 additions and 3 deletions

View File

@ -628,7 +628,7 @@ function filterDlgCheckDate() {
var reply = JSON.parse(transport.responseText); var reply = JSON.parse(transport.responseText);
if (reply['result'] == true) { if (reply['result'] == true) {
alert(__("Date syntax appears to be correct.")); alert(__("Date syntax appears to be correct:") + " " + reply['date']);
return; return;
} else { } else {
alert(__("Date syntax is incorrect.")); alert(__("Date syntax is incorrect."));

View File

@ -456,7 +456,8 @@
$date = db_escape_string($_REQUEST["date"]); $date = db_escape_string($_REQUEST["date"]);
$date_parsed = strtotime($date); $date_parsed = strtotime($date);
print json_encode(array("result" => (bool)$date_parsed)); print json_encode(array("result" => (bool)$date_parsed,
"date" => date("c", $date_parsed)));
return; return;
} }

View File

@ -466,7 +466,8 @@
name=\"reg_exp\" value=\"$reg_exp\"/>"; name=\"reg_exp\" value=\"$reg_exp\"/>";
print "<span id=\"filterDlg_dateChkBox\" style=\"display : none\">"; print "<span id=\"filterDlg_dateChkBox\" style=\"display : none\">";
print "&nbsp;<button onclick=\"return filterDlgCheckDate()\">". print "&nbsp;<button dojoType=\"dijit.form.Button\"
onclick=\"return filterDlgCheckDate()\">".
__('Check it')."</button>"; __('Check it')."</button>";
print "</span>"; print "</span>";