Using Intl javascript API in outlook addin

Andrew Filippov 1 Reputation point
2021-01-22T14:50:24.563+00:00

Hi. I have very odd behavior difference between OWA and desktop Outlook client.

I just tried to run follow code in js console:

console.log(
  new Intl.DateTimeFormat('en', { timeStyle: "short" }).format(Date.now()), 
  new Intl.DateTimeFormat('en', { dateStyle: "short" }).format(Date.now())
);

... and obtain follow outputs:

for OWA in Edge browser:

4:35 PM 1/22/21

for Desktop (using Microsoft Edge DevTools Preview):

1/22/2021 1/22/2021

Have I missed something?

Edge Browser ver. 88.0.705.50 (window.navigator.userAgent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.50)
Outlook - Outlook for Microsoft 365 MSO (16.0.13530.20418) 32-bit (window.navigator.userAgent = Mozilla/5.0 (Windows NT 10.0; Win64; x64; WebView/3.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18362)

Actually, it seems, that web-engine used under the hood in Desktop outlook doesn't support Intl.* objects. It simply ignores optional second argument for Intl.*Format constructors (regards to DateTimeFormat). So this question can be closed. Thanks.

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,557 questions
0 comments No comments
{count} votes