This repository has been archived by the owner on Sep 1, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix: Use
@guardian/tsconfig
#390fix: Use
@guardian/tsconfig
#390Changes from 2 commits
1e9c9fb
1a504be
861093a
af1e46f
15f7353
5dc53fe
4b8f951
f903765
db2285b
e7ea101
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah! a lot nicer :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oliverlloyd how do you feel about these? guardian is at 98.99% support (greater than es module support). are they going to have wierd unexpected effects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the other functions in this file return English strings, and the style guide is British English, is it possible we want to use
'en-GB'
here?I think using
'default'
will use the browser/system's default locale, and will therefore give the month in the language for that locale? For example, in French if the system is set to French. You can test this with the following snippet of code:in Node by setting the
LANG
environment variable:or in a browser by changing the macOS system language to e.g. French, restarting your browser, and then pulling up a console (tested in Firefox and Safari).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completely agree with @JamieB-gu here! I would be tempted to move this to a separate PR, as it’s possibly a breaking change, or at least most definitly a feature.
I am one such user who would not want my dates in French if I’m browsing an english-language website.
My suggestion for the existing code would be:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a great point –
'en-GB'
should resolve that though?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
then.toLocaleString('en-GB', { month: 'short' })
best respects the design guideThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that
toLocaleString
was not well supported in browsers, but it seems like that’s not the case, there’s only missing data for about 3% of browsers.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Support is available for everything that supports es modules afaict?