Skip to content

Commit

Permalink
Merge pull request #369 from PagerDuty/today
Browse files Browse the repository at this point in the history
  • Loading branch information
gsreynolds authored Dec 5, 2023
2 parents 62b3ff2 + 433694b commit 4ce162e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,14 @@ const DatePickerComponent = () => {

// Generate since date based on configured default and dispatch action for query.
const today = moment();
const [sinceDateNum, sinceDateTenor] = defaultSinceDateTenor
let [sinceDateNum, sinceDateTenor] = defaultSinceDateTenor
? defaultSinceDateTenor.split(' ')
: ['1', 'Day'];

if (defaultSinceDateTenor === 'Today') {
sinceDateNum = '0';
sinceDateTenor = 'Day';
}
const sinceDateCalc = DEBUG_SINCE_DATE
? new Date(DEBUG_SINCE_DATE)
: today
Expand Down
2 changes: 2 additions & 0 deletions src/util/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {

/* eslint-disable import/prefer-default-export */
export const defaultSinceDateTenors = [
'Today',
'1 Day',
'3 Days',
'1 Week',
Expand All @@ -23,6 +24,7 @@ export const defaultSinceDateTenorsLabels = () => {
t,
} = useTranslation();
return {
Today: t('Today'),
'1 Day': t('1 Day'),
'3 Days': t('3 Days'),
'1 Week': t('1 Week'),
Expand Down

0 comments on commit 4ce162e

Please sign in to comment.