MDL-50364 forms: consistent access to language strings from JS.
This commit is contained in:
+1
-1
@@ -112,7 +112,7 @@ M.form.dateselector = {
|
||||
require(['core/user_date', 'core/notification'], function(UserDate, Notification) {
|
||||
UserDate.get([{
|
||||
timestamp: Math.floor(date.getTime() / 1000),
|
||||
format: config.strftimemonthyear,
|
||||
format: M.util.get_string('strftimemonthyear', 'langconfig'),
|
||||
}]).then(function(dateStrs) {
|
||||
var headerNode = calendar.get('contentBox')
|
||||
.one('#' + calendar._calendarId + '_header');
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+1
-1
@@ -112,7 +112,7 @@ M.form.dateselector = {
|
||||
require(['core/user_date', 'core/notification'], function(UserDate, Notification) {
|
||||
UserDate.get([{
|
||||
timestamp: Math.floor(date.getTime() / 1000),
|
||||
format: config.strftimemonthyear,
|
||||
format: M.util.get_string('strftimemonthyear', 'langconfig'),
|
||||
}]).then(function(dateStrs) {
|
||||
var headerNode = calendar.get('contentBox')
|
||||
.one('#' + calendar._calendarId + '_header');
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ M.form.dateselector = {
|
||||
require(['core/user_date', 'core/notification'], function(UserDate, Notification) {
|
||||
UserDate.get([{
|
||||
timestamp: Math.floor(date.getTime() / 1000),
|
||||
format: config.strftimemonthyear,
|
||||
format: M.util.get_string('strftimemonthyear', 'langconfig'),
|
||||
}]).then(function(dateStrs) {
|
||||
var headerNode = calendar.get('contentBox')
|
||||
.one('#' + calendar._calendarId + '_header');
|
||||
|
||||
@@ -108,9 +108,9 @@ function form_init_date_js() {
|
||||
'october' => date_format_string(strtotime("October 1"), '%B', $defaulttimezone),
|
||||
'november' => date_format_string(strtotime("November 1"), '%B', $defaulttimezone),
|
||||
'december' => date_format_string(strtotime("December 1"), '%B', $defaulttimezone),
|
||||
'strftimemonthyear' => get_string('strftimemonthyear', 'langconfig'),
|
||||
));
|
||||
$PAGE->requires->yui_module($module, $function, $config);
|
||||
$PAGE->requires->string_for_js('strftimemonthyear', 'langconfig');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user