Merge branch '2063-Bug-cambio-hora-en-relojes-de-la-Consola-visual-dev' into 'develop'

Fixed issue with timezone in visual console editor

See merge request artica/pandorafms!1724
This commit is contained in:
nramon 2018-09-03 15:47:55 +02:00
commit 862c1ae8a7
1 changed files with 22 additions and 2 deletions

View File

@ -1574,8 +1574,28 @@ function loadFieldsFromDB(item) {
$("select[name=clock_animation]").val(val);
if (key == 'time_format')
$("select[name=time_format]").val(val);
if (key == 'timezone')
$("select[name=timezone]").val(val);
if (key == 'timezone') {
var zone = val.split("/");
$("select[name=zone]").val(zone[0]);
$.ajax({
type: "POST",
url: "ajax.php",
data: "page=godmode/setup/setup&select_timezone=1&zone=" + zone[0],
dataType: "json",
success: function(data) {
$("#timezone").empty();
jQuery.each (data, function (id, value) {
timezone = value;
var timezone_country = timezone.replace (/^.*\//g, "");
$("select[name='timezone']").append($("<option>").val(timezone).html(timezone_country));
if (timezone == val) {
$("select[name='timezone']").val(timezone);
}
});
}
});
}
if (key == 'value_show') {
$("select[name=value_show]").val(val);