Skip to content

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

Merged
merged 33 commits into from
Dec 9, 2016
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d2a5e4b
simpleMap utility so we don't pass unexpected args
alexcjohnson Dec 2, 2016
6151575
change gl2d_date_axes mock to date string axis range
alexcjohnson Nov 30, 2016
4b9edec
add world calendar support part 1
alexcjohnson Nov 30, 2016
4d8f79a
overhaul set_convert so I can tell where calendars go
alexcjohnson Dec 2, 2016
84a51c2
add world calendar support part 2
alexcjohnson Dec 2, 2016
13cf6b1
world-cals image mock
alexcjohnson Dec 4, 2016
165125b
fix 3d calendar attributes
alexcjohnson Dec 4, 2016
86b31ea
fix gl3d with world calendars
alexcjohnson Dec 5, 2016
78b6646
test world-cals in scattergl & gl2d axes
alexcjohnson Dec 5, 2016
1b563f5
test world calendars with finance charts
alexcjohnson Dec 5, 2016
4e9a632
remove mistaken paste
alexcjohnson Dec 6, 2016
c1c24e8
support world cals in rangesliders
alexcjohnson Dec 6, 2016
a435981
partial support for range selectors on world calendars
alexcjohnson Dec 6, 2016
6653da7
get the right date string replacement for candlestick mock
alexcjohnson Dec 6, 2016
8e1747f
bigger tolerance on updatemenus_test width test
alexcjohnson Dec 6, 2016
00ae2dd
fix and test layout.calendar inheritance
alexcjohnson Dec 6, 2016
3143099
move world-calendar logic in lib/dates.js to new 'calendars' component
etpinard Dec 6, 2016
5984106
coerce calendar attributes in calenders component
etpinard Dec 6, 2016
03ab34f
add requirable 'calendars' module + include it in main bundle
etpinard Dec 6, 2016
db3d18b
fix typo in getComponentMethod call
etpinard Dec 6, 2016
05b2f96
skip over calendar attribute in findArrayAttributes
etpinard Dec 6, 2016
61ecd42
generalise plot schema handling of component attributes
etpinard Dec 6, 2016
68af287
add schema attributes in calendars module
etpinard Dec 6, 2016
cb2c54b
move calendar defaults after early return
etpinard Dec 7, 2016
bc457a9
Merge pull request #1230 from plotly/world-cals-component
etpinard Dec 7, 2016
1444f55
use only the calendars we need from 'world-calendars'
etpinard Dec 7, 2016
08f18ca
Merge pull request #1237 from plotly/world-cals-trimmed
etpinard Dec 7, 2016
dcddcee
support chinese calendar
alexcjohnson Dec 8, 2016
bbb76a4
Merge branch 'master' into world-cals
alexcjohnson Dec 8, 2016
8d8e936
fix some tests for chinese, and robustify dateTime2ms
alexcjohnson Dec 8, 2016
0e05f95
update baseline image with chinese calendar
alexcjohnson Dec 8, 2016
509f287
perf: parseInt for string-leading int extraction
alexcjohnson Dec 9, 2016
7bd501f
prevent non-gregorian month/year todate range selectors
alexcjohnson Dec 9, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
"superscript-text": "^1.0.0",
"tinycolor2": "^1.3.0",
"topojson-client": "^2.1.0",
"webgl-context": "^2.2.0"
"webgl-context": "^2.2.0",
"world-calendars": "0.1.0"
Copy link
Contributor

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 ^ .

Copy link
Collaborator Author

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.

},
"devDependencies": {
"brfs": "^1.4.3",
Expand Down
15 changes: 15 additions & 0 deletions src/lib/coerce.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

'use strict';

var calendarList = Object.keys(require('world-calendars').calendars);
var isNumeric = require('fast-isnumeric');
var tinycolor = require('tinycolor2');

Expand Down Expand Up @@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

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

What's your reasoning for adding a valType instead of reusing enumerated?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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 world-calendars)

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll see what I can do here.

else propOut.set(dflt);
}
}
};

Expand Down
Loading