Commit 9c42a5c8 authored by Jon's avatar Jon Committed by everykittysdaydream
Browse files

Remote Time zone fix (#7)

parent 61c99521
......@@ -15,7 +15,7 @@
*
* @see http://wiki.civicrm.org/confluence/display/CRMDOC/API+Architecture+Standards
*/
function _civicrm_api3_importer_SetTime_spec(&$spec) {
function _civicrm_api3_importer_Settime_spec(&$spec) {
$spec['zone']['api.required'] = 1;
}
......@@ -31,7 +31,7 @@ function _civicrm_api3_importer_SetTime_spec(&$spec) {
*
* @throws API_Exception
*/
function civicrm_api3_importer_SetTime($params) {
function civicrm_api3_importer_Settime($params) {
Civi::settings()->set('server_time_zone', $params["zone"]);
$returnValues["result_zone"] = Civi::settings()->get("server_time_zone");
......
......@@ -400,14 +400,14 @@
CRM.$("#TimeForm").submit(function(e) {
var data = new Object();
var formResults = CRM.$("#OSDIRequestForm").serializeArray().map(function(x){
var formResults = CRM.$("#TimeForm").serializeArray().map(function(x){
data[x.name] = x.value;}
);
console.log("calling api");
console.log(JSON.stringify(data));
CRM.api3('Importer', 'SetTime', {
"server_time_zone": data["zone"]}).done(function(result) {
"zone": data["zone"]}).done(function(result) {
console.log(result);
alert(''.concat("Zone: ", result["values"]["result_zone"], " set successfully."));
});
......
Supports Markdown
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