@lightdash/common 0.1453.1 → 0.1454.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,11 +23,7 @@ export declare enum FeatureFlags {
23
23
  /**
24
24
  * Enable dashboard comments
25
25
  */
26
- DashboardComments = "dashboard-comments-enabled",
27
- /**
28
- * Enable metric trees
29
- */
30
- MetricTrees = "metric-trees"
26
+ DashboardComments = "dashboard-comments-enabled"
31
27
  }
32
28
  export type FeatureFlag = {
33
29
  id: string;
@@ -33,8 +33,4 @@ var FeatureFlags;
33
33
  * Enable dashboard comments
34
34
  */
35
35
  FeatureFlags["DashboardComments"] = "dashboard-comments-enabled";
36
- /**
37
- * Enable metric trees
38
- */
39
- FeatureFlags["MetricTrees"] = "metric-trees";
40
36
  })(FeatureFlags = exports.FeatureFlags || (exports.FeatureFlags = {}));
@@ -30,8 +30,8 @@ export declare const getMetricExplorerDataPointsWithCompare: (dimension: Dimensi
30
30
  };
31
31
  /**
32
32
  * Get the date range for a given time interval, based on the current date and the time interval
33
- * Time grain Year: -> this year (i.e. start of this year until now)
34
- * Time grain Month -> past 3 months (i.e. 3 completed months + this uncompleted month)
33
+ * Time grain Year: -> past 3 years (i.e. 3 completed years + this uncompleted year)
34
+ * Time grain Month -> past 12 months (i.e. 12 completed months + this uncompleted month)
35
35
  * Time grain Week -> past 12 weeks (i.e. 12 completed weeks + this uncompleted week)
36
36
  * Time grain Day -> past 30 days (i.e. 30 completed days + this uncompleted day)
37
37
  * @param timeInterval - The time interval
@@ -266,8 +266,8 @@ const getMetricExplorerDataPointsWithCompare = (dimension, compareDimension, met
266
266
  exports.getMetricExplorerDataPointsWithCompare = getMetricExplorerDataPointsWithCompare;
267
267
  /**
268
268
  * Get the date range for a given time interval, based on the current date and the time interval
269
- * Time grain Year: -> this year (i.e. start of this year until now)
270
- * Time grain Month -> past 3 months (i.e. 3 completed months + this uncompleted month)
269
+ * Time grain Year: -> past 3 years (i.e. 3 completed years + this uncompleted year)
270
+ * Time grain Month -> past 12 months (i.e. 12 completed months + this uncompleted month)
271
271
  * Time grain Week -> past 12 weeks (i.e. 12 completed weeks + this uncompleted week)
272
272
  * Time grain Day -> past 30 days (i.e. 30 completed days + this uncompleted day)
273
273
  * @param timeInterval - The time interval
@@ -288,11 +288,14 @@ const getDefaultDateRangeFromInterval = (timeInterval) => {
288
288
  ];
289
289
  case timeFrames_1.TimeFrames.MONTH:
290
290
  return [
291
- now.subtract(3, 'month').startOf('month').toDate(),
291
+ now.subtract(12, 'month').startOf('month').toDate(),
292
292
  now.toDate(),
293
293
  ];
294
294
  case timeFrames_1.TimeFrames.YEAR:
295
- return [now.startOf('year').toDate(), now.toDate()];
295
+ return [
296
+ now.subtract(3, 'year').startOf('year').toDate(),
297
+ now.toDate(),
298
+ ];
296
299
  default:
297
300
  return (0, exports.assertUnimplementedTimeframe)(timeInterval);
298
301
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/common",
3
- "version": "0.1453.1",
3
+ "version": "0.1454.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [