Closed Bug 1380751 Opened 3 years ago Closed 3 years ago

Use mozIntl in minimonth.xml

Categories

(Calendar :: General, enhancement, P3)

Lightning 5.7
enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jorgk-bmo, Assigned: jorgk-bmo)

References

Details

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #1350679 +++

See bug 1350679 comment #23:
there exist further places where a date formatting still doesn't use mozIntl yet:
https://dxr.mozilla.org/comm-central/search?q=path%3Aminimonth.xml+tolocale&redirect=false
(the two last hits in minimonth.xml)
If someone could give me some steps to find the aria-label, I'd be happy to submit a patch.
 938 day.setAttribute("aria-label", date.toLocaleDateString(undefined, labelDateOptions));
1089 label = this.mValue.toLocaleDateString(undefined, labelDateOptions);
Flags: needinfo?(Mozilla)
As mentioned in the other bug, use the dom inspector (inspect the TB main window, use its find node functionality and click on a day in minimonth, so you get displayed the relavant section of nodes). The current month's days have only a numeric day in the aria label, but days of previous or subsequent months have day and month in it - you can see that when inspecting the node list. Also, the minimonth box has a full date in the aria-label.
Flags: needinfo?(Mozilla)
(In reply to [:MakeMyDay] from comment #2)
> The current month's days
> have only a numeric day in the aria label, but days of previous or
> subsequent months have day and month in it - you can see that when
> inspecting the node list.
Found it. I use "Element Inspector", which let's you Shift+Right-Click onto the element you want to inspect.

> Also, the minimonth box has a full date in the aria-label.
I found that too now, id=today-Minimonth.
Assignee: nobody → jorgk
Status: NEW → ASSIGNED
This should do it. Note that mozIntl can't do "5 Aug", so if month or year don't match, I'm doing the full date.

I hope that doesn't break any tests, since some (unfortunately) actually look at aria-labels
https://dxr.mozilla.org/comm-central/rev/130d043e685055c682059c92dc582acb2a65afd2/calendar/test/mozmill/testBasicFunctionality.js#46
but I guess not the ones which have more than the day.

There's been discussion in changing those tests, but that turned out (too) hard (bug 472448 comment #75).
Attachment #8886775 - Flags: review?(makemyday)
Comment on attachment 8886775 [details] [diff] [review]
1380751-minimonth.patch (v1).

Review of attachment 8886775 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks. r+ with the below nit fixed. The mozmill test shouldn't fail as it referrs to the 1st day of the current month, which representation isn't changed by this patch, but please kick off a try run before landing to be sure we get a green mozmill test.

::: calendar/base/content/widgets/minimonth.xml
@@ +931,5 @@
>                    }
>  
> +                  if (aDate.getMonth() == date.getMonth() &&
> +                      aDate.getFullYear() == date.getFullYear()) {
> +                      day.setAttribute("aria-label", date.toLocaleDateString(undefined, { day: 'numeric' }));

Can you please switch to double quotes here (I kown it have been single quotes already before).
Attachment #8886775 - Flags: review?(makemyday) → review+
https://hg.mozilla.org/comm-central/rev/c581127bdaff3f5f3cfbee6af84f5e7290a79773

Landed with the quotes fixed.
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Version: Lightning 5.7 → Lightning 5.8
Target Milestone: --- → 5.8
Version: Lightning 5.8 → Lightning 5.7
Comment on attachment 8886775 [details] [diff] [review]
1380751-minimonth.patch (v1).

Last piece of implementing mozIntl in calendar (still one chat bug to go before it's 100% done).
Attachment #8886775 - Flags: approval-calendar-beta?(philipp)
Attachment #8886775 - Flags: approval-calendar-beta?(philipp) → approval-calendar-beta+
You need to log in before you can comment on or make changes to this bug.