timezone setting

pull/578/head
qkqpttgf 2020-04-05 13:47:32 +08:00 committed by GitHub
parent a1abd4d5ca
commit 064da3da9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -119,7 +119,8 @@ function install()
if ($_GET['install2']) { if ($_GET['install2']) {
if ($_POST['admin']!='') { if ($_POST['admin']!='') {
$tmp['admin'] = $_POST['admin']; $tmp['admin'] = $_POST['admin'];
$tmp['language'] = $_POST['language']; $tmp['language'] = $_COOKIE['language'];
$tmp['timezone'] = $_COOKIE['timezone'];
$response = setConfig($tmp); $response = setConfig($tmp);
if (api_error($response)) { if (api_error($response)) {
$html = api_error_msg($response); $html = api_error_msg($response);
@ -149,6 +150,12 @@ function install()
</form> </form>
</div> </div>
<script> <script>
var nowtime= new Date();
var timezone = 0-nowtime.getTimezoneOffset()/60;
var expd = new Date();
expd.setTime(expd.getTime()+(2*60*60*1000));
var expires = "expires="+expd.toGMTString();
document.cookie="timezone="+timezone+"; path=/; "+expires;
function notnull(t) function notnull(t)
{ {
if (t.admin.value==\'\') { if (t.admin.value==\'\') {