Skip to content

Commit 393069f

Browse files
committed
Manually set hours, minutes, seconds and milliseconds to zero
- Using setUTCHours will use UTC as reference while setting the values
1 parent 9c2e001 commit 393069f

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

community-dashboard/app/Base/utils/temporal.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ export function resolveTime(date: Date | number | string, resolution: 'day' | 'm
1212
const newDate = getDateSafe(date);
1313

1414
if (resolution === 'day' || resolution === 'month' || resolution === 'year') {
15-
newDate.setUTCHours(0, 0, 0, 0);
15+
newDate.setHours(0);
16+
newDate.setMinutes(0);
17+
newDate.setSeconds(0);
18+
newDate.setMilliseconds(0);
1619
}
1720
if (resolution === 'month' || resolution === 'year') {
1821
newDate.setDate(1);
@@ -45,7 +48,10 @@ export function getTimestamps(
4548
} else {
4649
myDate.setDate(sanitizedStartDate.getDate() + increment);
4750
}
48-
myDate.setUTCHours(0, 0, 0, 0);
51+
myDate.setHours(0);
52+
myDate.setMinutes(0);
53+
myDate.setSeconds(0);
54+
myDate.setMilliseconds(0);
4955

5056
if (myDate > sanitizedEndDate) {
5157
break;

community-dashboard/app/components/SelectInput/SearchSelectInput.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ function Option(props: OptionProps) {
3232
);
3333
}
3434

35-
type Def = { containerClassName?: string, title?: string };
35+
type Def = {
36+
containerClassName?: string,
37+
children?: React.ReactNode,
38+
title?: string,
39+
};
3640
type OptionKey = string | number;
3741

3842
export type SearchSelectInputProps<
@@ -41,7 +45,7 @@ export type SearchSelectInputProps<
4145
O extends object, // eslint-disable-line
4246
P extends Def,
4347
OMISSION extends string,
44-
> = Omit<{
48+
> = Omit<{
4549
value: T | undefined | null;
4650
options: O[] | undefined | null;
4751
searchOptions?: O[] | undefined | null;
@@ -55,7 +59,7 @@ export type SearchSelectInputProps<
5559
onSearchValueChange?: (value: string) => void;
5660
onShowDropdownChange?: (value: boolean) => void;
5761
optionRenderer?: (props: Pick<P, Exclude<keyof P, 'containerClassName' | 'title'>>) => React.ReactNode;
58-
optionRendererParams?: (optionKey: OptionKey, option: O) => P;
62+
optionRendererParams?: (optionKey: T, option: O) => P;
5963
}, OMISSION> & (
6064
SelectInputContainerProps<T, K, O, P,
6165
'name'
@@ -218,7 +222,7 @@ function SearchSelectInput<
218222
);
219223

220224
const optionRendererParamsDefault = useCallback(
221-
(key: OptionKey, option: O) => {
225+
(key: T, option: O) => {
222226
const isActive = key === value;
223227

224228
return {

community-dashboard/app/views/UserGroupDashboard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ function UserGroupDashboard(props: Props) {
280280
<Button
281281
disabled={userGroupStatsDownloadLoading}
282282
onClick={getUserGroupStatsDownload}
283-
name="export"
283+
name={undefined}
284284
>
285285
{ userGroupStatsDownloadLoading ? 'Exporting' : 'Export' }
286286
</Button>

0 commit comments

Comments
 (0)