Skip to content

Commit

Permalink
fix: Invalid Date: Incorrect MySQL minutes granularity
Browse files Browse the repository at this point in the history
  • Loading branch information
paveltiunov committed Feb 11, 2020
1 parent 35366aa commit dc553b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/cubejs-schema-compiler/adapter/MysqlQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const GRANULARITY_TO_INTERVAL = {
day: (date) => `DATE_FORMAT(${date}, '%Y-%m-%dT00:00:00.000')`,
week: (date) => `DATE_FORMAT(date_add('1900-01-01', interval TIMESTAMPDIFF(WEEK, '1900-01-01', ${date}) WEEK), '%Y-%m-%dT00:00:00.000')`,
hour: (date) => `DATE_FORMAT(${date}, '%Y-%m-%dT%H:00:00.000')`,
minute: (date) => `DATE_FORMAT(${date}, '%Y-%m-%dT%H:%M:00.000')`,
second: (date) => `DATE_FORMAT(${date}, '%Y-%m-%dT%H:%M:%S.000')`,
minute: (date) => `DATE_FORMAT(${date}, '%Y-%m-%dT%H:%i:00.000')`,
second: (date) => `DATE_FORMAT(${date}, '%Y-%m-%dT%H:%i:%S.000')`,
month: (date) => `DATE_FORMAT(${date}, '%Y-%m-01T00:00:00.000')`,
year: (date) => `DATE_FORMAT(${date}, '%Y-01-01T00:00:00.000')`
};
Expand Down

0 comments on commit dc553b9

Please sign in to comment.