Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
223419d9
Commit
223419d9
authored
Nov 21, 2017
by
Tim Hunt
Browse files
MDL-60682 forms: date/times should use step 1 minute by default
parent
4275ea4a
Changes
5
Show whitespace changes
Inline
Side-by-side
calendar/tests/calendartype_test.php
View file @
223419d9
...
...
@@ -221,9 +221,11 @@ class core_calendar_type_testcase extends advanced_testcase {
$counter
++
;
if
(
$element
==
'dateselector'
)
{
$el
=
$this
->
mform
->
addElement
(
'date_selector'
,
'dateselector'
.
$counter
,
null
,
array
(
'timezone'
=>
0.0
,
'step'
=>
1
));
$el
=
$this
->
mform
->
addElement
(
'date_selector'
,
'dateselector'
.
$counter
,
null
,
array
(
'timezone'
=>
0.0
));
}
else
{
$el
=
$this
->
mform
->
addElement
(
'date_time_selector'
,
'dateselector'
.
$counter
,
null
,
array
(
'timezone'
=>
0.0
,
'step'
=>
1
,
'optional'
=>
false
));
$el
=
$this
->
mform
->
addElement
(
'date_time_selector'
,
'dateselector'
.
$counter
,
null
,
array
(
'timezone'
=>
0.0
,
'optional'
=>
false
));
}
$submitvalues
=
array
(
'dateselector'
.
$counter
=>
$date
);
...
...
lib/form/dateselector.php
View file @
223419d9
...
...
@@ -79,7 +79,7 @@ class MoodleQuickForm_date_selector extends MoodleQuickForm_group {
// Get the calendar type used - see MDL-18375.
$calendartype
=
\
core_calendar\type_factory
::
get_calendar_instance
();
$this
->
_options
=
array
(
'startyear'
=>
$calendartype
->
get_min_year
(),
'stopyear'
=>
$calendartype
->
get_max_year
(),
'defaulttime'
=>
0
,
'timezone'
=>
99
,
'step'
=>
5
,
'optional'
=>
false
);
'defaulttime'
=>
0
,
'timezone'
=>
99
,
'step'
=>
1
,
'optional'
=>
false
);
// TODO MDL-52313 Replace with the call to parent::__construct().
HTML_QuickForm_element
::
__construct
(
$elementName
,
$elementLabel
,
$attributes
);
$this
->
_persistantFreeze
=
true
;
...
...
lib/form/datetimeselector.php
View file @
223419d9
...
...
@@ -81,7 +81,7 @@ class MoodleQuickForm_date_time_selector extends MoodleQuickForm_group {
// Get the calendar type used - see MDL-18375.
$calendartype
=
\
core_calendar\type_factory
::
get_calendar_instance
();
$this
->
_options
=
array
(
'startyear'
=>
$calendartype
->
get_min_year
(),
'stopyear'
=>
$calendartype
->
get_max_year
(),
'defaulttime'
=>
0
,
'timezone'
=>
99
,
'step'
=>
5
,
'optional'
=>
false
);
'defaulttime'
=>
0
,
'timezone'
=>
99
,
'step'
=>
1
,
'optional'
=>
false
);
// TODO MDL-52313 Replace with the call to parent::__construct().
HTML_QuickForm_element
::
__construct
(
$elementName
,
$elementLabel
,
$attributes
);
...
...
lib/form/defaultcustom.php
View file @
223419d9
...
...
@@ -77,7 +77,7 @@ class MoodleQuickForm_defaultcustom extends MoodleQuickForm_group {
'startyear'
=>
$calendartype
->
get_min_year
(),
'stopyear'
=>
$calendartype
->
get_max_year
(),
'defaulttime'
=>
0
,
'step'
=>
5
,
'step'
=>
1
,
'optional'
=>
false
,
];
...
...
mod/quiz/mod_form.php
View file @
223419d9
...
...
@@ -37,7 +37,7 @@ require_once($CFG->dirroot . '/mod/quiz/locallib.php');
*/
class
mod_quiz_mod_form
extends
moodleform_mod
{
/** @var array options to be used with date_time_selector fields in the quiz. */
public
static
$datefieldoptions
=
array
(
'optional'
=>
true
,
'step'
=>
1
);
public
static
$datefieldoptions
=
array
(
'optional'
=>
true
);
protected
$_feedbacks
;
protected
static
$reviewfields
=
array
();
// Initialised in the constructor.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment