MDL-50364 forms: consistent access to language strings from JS.

This commit is contained in:
Paul Holden
2026-01-16 15:18:08 +08:00
committed by Jake Dallimore
parent fd5d67ff9b
commit 4fc5e4ea13
5 changed files with 6 additions and 6 deletions
@@ -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');
File diff suppressed because one or more lines are too long
@@ -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
View File
@@ -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');
+1 -1
View File
@@ -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');
}
}