Skip to content

Commit

Permalink
Replace dayjs(newDate()) invocations with dayjs()
Browse files Browse the repository at this point in the history
  • Loading branch information
adhityamamallan committed Jan 17, 2025
1 parent 035cf68 commit 242d02a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/components/date-filter/date-filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,11 @@ export default function DateFilter({
}}
quickSelectOptions={QUICK_SELECT_OPTIONS.map(
({ label, durationSeconds }) => {
const now = new Date();
const now = dayjs();
return {
id: label,
beginDate: dayjs(now)
.subtract(durationSeconds, 'seconds')
.toDate(),
endDate: now,
beginDate: now.subtract(durationSeconds, 'seconds').toDate(),
endDate: now.toDate(),
};
}
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function DomainWorkflowsArchivalHeader({
!queryParams.timeRangeStartArchival &&
!queryParams.timeRangeEndArchival
) {
const now = dayjs(new Date());
const now = dayjs();
setQueryParams({
timeRangeStartArchival: now
.subtract(DOMAIN_WORKFLOWS_ARCHIVAL_START_DAYS_CONFIG, 'days')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function DomainWorkflowsBasicFilters() {

useEffect(() => {
if (!queryParams.timeRangeStart && !queryParams.timeRangeEnd) {
const now = dayjs(new Date());
const now = dayjs();
setQueryParams({
timeRangeStart: now
.subtract(DOMAIN_WORKFLOWS_BASIC_START_DAYS_CONFIG, 'days')
Expand Down

0 comments on commit 242d02a

Please sign in to comment.