Skip to content

Commit

Permalink
Revert PR apache#8450
Browse files Browse the repository at this point in the history
  • Loading branch information
shmsr committed Nov 13, 2019
1 parent 17b00d5 commit 47cca3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,8 @@ const COMMON_TIME_FRAMES = [
const TIME_GRAIN_OPTIONS = ['seconds', 'minutes', 'hours', 'days', 'weeks', 'months', 'years'];

const MOMENT_FORMAT = 'YYYY-MM-DD[T]HH:mm:ss';
const DEFAULT_SINCE = moment()
.utc()
.startOf('day')
.subtract(7, 'days')
.format(MOMENT_FORMAT);
const DEFAULT_UNTIL = moment()
.utc()
.startOf('day')
.format(MOMENT_FORMAT);
const DEFAULT_SINCE = moment().startOf('day').subtract(7, 'days').format(MOMENT_FORMAT);
const DEFAULT_UNTIL = moment().startOf('day').format(MOMENT_FORMAT);
const SEPARATOR = ' : ';
const FREEFORM_TOOLTIP = t(
'Superset supports smart date parsing. Strings like `last sunday` or ' +
Expand Down Expand Up @@ -116,12 +109,8 @@ function getStateFromCommonTimeFrame(value) {
tab: TABS.DEFAULTS,
type: TYPES.DEFAULTS,
common: value,
since: moment()
.utc()
.startOf('day')
.subtract(1, units)
.format(MOMENT_FORMAT),
until: moment().utc().startOf('day').format(MOMENT_FORMAT),
since: moment().startOf('day').subtract(1, units).format(MOMENT_FORMAT),
until: moment().startOf('day').format(MOMENT_FORMAT),
};
}

Expand All @@ -130,15 +119,13 @@ function getStateFromCustomRange(value) {
let since;
let until;
if (rel === RELATIVE_TIME_OPTIONS.LAST) {
until = moment().utc().startOf('day').format(MOMENT_FORMAT);
until = moment().startOf('day').format(MOMENT_FORMAT);
since = moment()
.utc()
.startOf('day')
.subtract(num, grain)
.format(MOMENT_FORMAT);
} else {
until = moment()
.utc()
.startOf('day')
.add(num, grain)
.format(MOMENT_FORMAT);
Expand Down
8 changes: 0 additions & 8 deletions superset/assets/src/explore/controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1026,14 +1026,6 @@ export const controls = {
freeForm: true,
label: t('Time range'),
default: t('No filter'),
description: t(
'The time range for the visualization. All relative times, e.g. "Last month", ' +
'"Last 7 days", "now", etc. are evaluated on the server using the server\'s ' +
'local time (sans timezone). All tooltips and placeholder times are expressed ' +
'in UTC (sans timezone). The timestamps are then evaluated by the database ' +
'using the engine\'s local timezone. Note one can explicitly set the timezone ' +
'per the ISO 8601 format if specifying either the start and/or end time.',
),
},

max_bubble_size: {
Expand Down

0 comments on commit 47cca3e

Please sign in to comment.