Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions html/fm.html
Original file line number Diff line number Diff line change
Expand Up @@ -3663,6 +3663,12 @@
</div>
<div class="radio-txt">[$19929]</div>
</div>
<div class="label-wrap align-top">
<div class="uidateformat radioOff" id="rad18_div">
<input type="radio" id="rad18" class="uidateformat radioOff" value="2">
</div>
<div class="radio-txt">[$25082]</div>
</div>
</div>
</div>
<!-- Lets hide this for now -->
Expand Down
20 changes: 18 additions & 2 deletions js/utils/locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ function setDateTimeFormat(locales, format) {
* 14: 2021 (Only year)
* 15: dd mm (Date format with short month and without time and year)
* 16: dd (Only day)
*
* Note: When `fmconfig.uidateformat` is `2`, short date formats (0, 1) are rendered
* as dd.mm.yyyy (or dd.mm.yyyy hh:mm) regardless of locale, the same way
* `uidateformat === 1` forces the ISO yyyy-mm-dd rendering.
*/
function time2date(unixTime, format) {
'use strict';
Expand All @@ -310,10 +314,22 @@ function time2date(unixTime, format) {
return isodate.toISOString().replace('T', ' ').substr(0, length);
};

// print time as dd.mm.yyyy (or dd.mm.yyyy hh:mm) date format
var printDMY = function _printDMY() {
var isodate = printISO();
var datePart = isodate.substr(0, 10).split('-');
var dmy = datePart[2] + '.' + datePart[1] + '.' + datePart[0];

return format === 0 ? dmy + isodate.substr(10) : dmy;
};

dateFunc = dFObj === 'ISO' ? printISO : dFObj.format;

// if it is short date format and user selected to use ISO format
if ((fmconfig.uidateformat || countryAndLocales.country === 'ISO') && format < 2) {
// if it is short date format and user selected to use ISO or DD.MM.YYYY format
if (format < 2 && fmconfig.uidateformat === 2) {
result = printDMY();
}
else if ((fmconfig.uidateformat || countryAndLocales.country === 'ISO') && format < 2) {
result = printISO();
}
else {
Expand Down
1 change: 1 addition & 0 deletions lang/en_prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -2613,6 +2613,7 @@
"25049": "Payment failed",
"25050": "Unfortunately, the payment did not go through. If you believe that this is an error on MEGA\u2019s part, please contact support at [A]https://mega.nz/support[/A]",
"25081": "Thanks. Your account upgrade will be applied in the next few minutes.\nIf this is a new account and you haven\u2019t verified your email address yet, please do this now.",
"25082": "Use the day, month, year format (DD.MM.YYYY)",
"about_no_vacancies_available": "No vacancies available currently.",
"about_our_promise_title": "Our promise",
"ac_closure_email_sent_msg": "An email was sent to %s with a link to close your account.",
Expand Down