Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

feat(dateFilter): add support for STANDALONEMONTH in format (LLLL) #14013

Conversation

gkalpak
Copy link
Member

@gkalpak gkalpak commented Feb 11, 2016

Fixes #13999

return function(date, formats) {
var value = date['get' + name]();
var get = uppercase(shortForm ? ('SHORT' + name) : name);
var propName = formatProp || name;
var get = uppercase(shortForm ? ('SHORT' + propName) : propName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we change this to

function dateStrGetter(name, shortForm, propPrefix) {
...
var get = uppercase((propPrefix || '') + (shortForm ? 'Short' : '') + name);
...

And also change the line below to

LLLL: dateStrGetter('Month', false, 'Standalone'),

Then, in the future, we can implement LLL by just doing

LLL: dateStrGetter('Month', true, 'Standalone'),

[To change Standalone to a boolean is also fine]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point ! (It was late 😛)
I went with the boolean (but it's easy to switch to a string prefix if needed).

@lgalfaso
Copy link
Contributor

LGTM

@gkalpak
Copy link
Member Author

gkalpak commented Feb 12, 2016

Backported to v1.5.x as 3e5b25b.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants