Skip to content

Commit

Permalink
fix(charts): updating default time formats
Browse files Browse the repository at this point in the history
Using 24 hour time.
Only showing month, removing year.
  • Loading branch information
markmcdowell committed Nov 27, 2019
1 parent c47ef67 commit 6670952
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions packages/charts/src/scale/levels.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
export const defaultFormatters = {
yearFormat: "%Y",
quarterFormat: "%b %Y",
quarterFormat: "%b",
monthFormat: "%b",
weekFormat: "%d %b",
dayFormat: "%a %d",
hourFormat: "%_I %p",
minuteFormat: "%I:%M %p",
secondFormat: "%I:%M:%S %p",
weekFormat: "%e",
dayFormat: "%e",
hourFormat: "%H:%M",
minuteFormat: "%H:%M",
secondFormat: "%H:%M:%S",
milliSecondFormat: "%L",
};

export const levelDefinition = [
/* eslint-disable no-unused-vars */
/* 19 */(d, date, i) => d.startOfYear && date.getFullYear() % 12 === 0 && "yearFormat",
/* 18 */(d, date, i) => d.startOfYear && date.getFullYear() % 4 === 0 && "yearFormat",
/* 17 */(d, date, i) => d.startOfYear && date.getFullYear() % 2 === 0 && "yearFormat",
Expand All @@ -32,5 +31,4 @@ export const levelDefinition = [
/* 2 */(d, date, i) => d.startOfMinute && "minuteFormat",
/* 1 */(d, date, i) => d.startOf30Seconds && "secondFormat",
/* 0 */(d, date, i) => "secondFormat",
/* eslint-enable no-unused-vars */
];

0 comments on commit 6670952

Please sign in to comment.