@@ -20,25 +20,6 @@ define(['jquery', 'core/modal_factory', 'core/templates', 'core/str', 'core/url'
20
20
} ;
21
21
} ;
22
22
23
- var pad = function pad ( num , size ) {
24
- var s = num + "" ;
25
- while ( s . length < size ) {
26
- s = "0" + s ;
27
- }
28
- return s ;
29
- } ;
30
-
31
- var get_time_as_string = function ( key ) {
32
- var startmin = $ ( '[name=minute_' + key + ']' ) . last ( ) [ 0 ] . selectedIndex ;
33
- var starthour = $ ( '[name=hour_' + key + ']' ) . last ( ) [ 0 ] . selectedIndex ;
34
- var startday = $ ( '[name=day_' + key + ']' ) . last ( ) [ 0 ] . selectedIndex + 1 ;
35
- var startmonth = $ ( '[name=month_' + key + ']' ) . last ( ) [ 0 ] . selectedIndex + 1 ;
36
- var startyear = $ ( '[name=year_' + key + ']' ) . last ( ) [ 0 ] . selectedIndex + 2000 ;
37
-
38
- return pad ( startday , 2 ) + '.' + pad ( startmonth , 2 ) + '.' + pad ( startyear , 2 ) + ' '
39
- + pad ( starthour , 2 ) + ':' + pad ( startmin , 2 ) ;
40
- } ;
41
-
42
23
var ready = function ( ) {
43
24
if ( this . readyState === 4 && this . status >= 200 && ! ( this . responseText == "" ) ) {
44
25
require ( [ 'core/notification' , ] , function ( notification ) {
@@ -71,7 +52,7 @@ define(['jquery', 'core/modal_factory', 'core/templates', 'core/str', 'core/url'
71
52
root . on ( 'modal-save-cancel:save' , function ( ) {
72
53
var saveid = new URL ( clickedLink . prop ( 'href' ) ) . searchParams . get ( "id" ) ;
73
54
var times = { } ;
74
- var settime = document . getElementById ( "standardtimecheck" ) . checked ;
55
+ var settime = $ ( '[name=use_standardtime]' ) . last ( ) [ 0 ] . checked ;
75
56
if ( settime ) {
76
57
times = get_timestamp ( ) ;
77
58
}
@@ -85,7 +66,7 @@ define(['jquery', 'core/modal_factory', 'core/templates', 'core/str', 'core/url'
85
66
startdates [ elementNo ] = times . starttime ;
86
67
enddates [ elementNo ] = times . endtime ;
87
68
if ( settime ) {
88
- str . get_string ( 'time_set' , 'block_evasys_sync' , function ( s ) {
69
+ str . get_string ( 'time_set' , 'block_evasys_sync' ) . done ( function ( s ) {
89
70
document . getElementById ( 'timehint_' + elementNo ) . innerHTML = s ;
90
71
} ) ;
91
72
} else {
@@ -99,7 +80,7 @@ define(['jquery', 'core/modal_factory', 'core/templates', 'core/str', 'core/url'
99
80
startdates [ elementNo ] = Date . now ( ) / 1000 ;
100
81
enddates [ elementNo ] = Date . now ( ) / 1000 ;
101
82
} else {
102
- document . getElementById ( "standardtimecheck" ) . checked = true ;
83
+ $ ( '[name=use_standardtime]' ) . last ( ) [ 0 ] . checked = true ;
103
84
}
104
85
timesetter . init ( startdates [ elementNo ] , enddates [ elementNo ] ) ;
105
86
} ) ;
0 commit comments