Skip to content

Commit 1e28356

Browse files
authored
Release v1.1.0-alpha as @next (#13)
* Fix imports for ES6, target v3 * Bump version
1 parent 06c79b6 commit 1e28356

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Read more about jsDeliver versioning on their [website](http://www.jsdelivr.com/
4242
date-fns requires a date-fns locale object to be tagged on to each `format()` call, which requires the locale to be explicitly set via the `adapters.date` option: [Chart.js documentation on adapters.date](https://www.chartjs.org/docs/latest/axes/cartesian/time.html?h=adapter)
4343

4444
For example:
45+
4546
```javascript
4647
// import date-fns locale:
4748
import {de} from 'date-fns/locale';

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "chartjs-adapter-date-fns",
33
"homepage": "https://www.chartjs.org",
44
"description": "Chart.js adapter to use date-fns for time functionalities",
5-
"version": "1.0.0-alpha4",
5+
"version": "1.1.0-alpha",
66
"license": "MIT",
77
"main": "dist/chartjs-adapter-date-fns.js",
88
"repository": {
@@ -20,17 +20,17 @@
2020
"dist/*.js"
2121
],
2222
"devDependencies": {
23-
"@rollup/plugin-node-resolve": "^7.0.0",
24-
"date-fns": "^2.9.0",
23+
"@rollup/plugin-node-resolve": "^7.1.3",
24+
"date-fns": "^2.12.0",
2525
"eslint-config-chartjs": "^0.1.0",
2626
"gulp": "^4.0.0",
2727
"gulp-eslint": "^5.0.0",
2828
"gulp-file": "^0.4.0",
29-
"rollup": "^1.29.0",
30-
"rollup-plugin-terser": "^5.1.3",
31-
"yargs": "^13.2.1"
29+
"rollup": "^1.32.1",
30+
"rollup-plugin-terser": "^5.3.0",
31+
"yargs": "^13.3.2"
3232
},
3333
"peerDependencies": {
34-
"chart.js": ">= 2.8.0 < 3"
34+
"chart.js": "^3.0.0-alpha"
3535
}
3636
}

src/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { _adapters, helpers } from 'chart.js';
1+
import Chart from 'chart.js';
22
import {
33
parse, parseISO, toDate, isValid, format,
44
startOfSecond, startOfMinute, startOfHour, startOfDay,
@@ -12,7 +12,7 @@ import {
1212
endOfWeek, endOfMonth, endOfQuarter, endOfYear
1313
} from 'date-fns';
1414

15-
var FORMATS = {
15+
const FORMATS = {
1616
datetime: 'MMM d, yyyy, h:mm:ss aaaa',
1717
millisecond: 'h:mm:ss.SSS aaaa',
1818
second: 'h:mm:ss aaaa',
@@ -25,18 +25,18 @@ var FORMATS = {
2525
year: 'yyyy'
2626
};
2727

28-
_adapters._date.override({
28+
Chart._adapters._date.override({
2929
_id: 'date-fns', // DEBUG
3030

3131
formats: function() {
3232
return FORMATS;
3333
},
3434

3535
parse: function(value, fmt) {
36-
if (helpers.isNullOrUndef(value)) {
36+
if (Chart.helpers.isNullOrUndef(value)) {
3737
return null;
3838
}
39-
var type = typeof value;
39+
const type = typeof value;
4040
if (type === 'number' || value instanceof Date) {
4141
value = toDate(value);
4242
} else if (type === 'string') {

0 commit comments

Comments
 (0)