-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
World calendars #1220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
World calendars #1220
Changes from 1 commit
d2a5e4b
6151575
4b9edec
4d8f79a
84a51c2
13cf6b1
165125b
86b31ea
78b6646
1b563f5
4e9a632
c1c24e8
a435981
6653da7
8e1747f
00ae2dd
3143099
5984106
03ab34f
db3d18b
05b2f96
61ecd42
68af287
cb2c54b
bc457a9
1444f55
08f18ca
dcddcee
bbb76a4
8d8e936
0e05f95
509f287
7bd501f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
|
||
'use strict'; | ||
|
||
var calendarList = Object.keys(require('world-calendars').calendars); | ||
var isNumeric = require('fast-isnumeric'); | ||
var tinycolor = require('tinycolor2'); | ||
|
||
|
@@ -267,6 +268,20 @@ exports.valObjects = { | |
|
||
return true; | ||
} | ||
}, | ||
calendar: { | ||
description: [ | ||
'A string, one of the calendar systems available', | ||
'in the `world-calendars` package, to be used in evaluating', | ||
'or displaying date data. Defaults to built-in (Gregorian) dates.', | ||
'available calendars:', '*' + calendarList.join('*, *') + '*' | ||
].join(' '), | ||
requiredOpts: [], | ||
otherOpts: ['dflt'], | ||
coerceFunction: function(v, propOut, dflt) { | ||
if(v && calendarList.indexOf(v) !== -1) propOut.set(v); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's your reasoning for adding a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just so I didn't have to reference the calendar list all the time. (Oh right, if we componentize, that's a second reference to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll see what I can do here. |
||
else propOut.set(dflt); | ||
} | ||
} | ||
}; | ||
|
||
|
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.
Arguably wrong (depending on how much you ❤️ npm), but dependencies in libraries are commonly listed with leading
^
.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.
👍 when we get @n-riesco 's Chinese in
world-calendars
I'll change the pattern here - and probably bump it to 1.0.0 at that point since it's doing its job.