Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/modules/reserve-overview/TimeRangeSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export interface TimeRangeSelectorProps {

const formattedInterval = (interval: TimeWindow) => {
switch (interval) {
case TimeWindow.LastDay:
return '1d';
case TimeWindow.LastWeek:
return '1w';
case TimeWindow.LastMonth:
Expand Down
4 changes: 2 additions & 2 deletions src/modules/reserve-overview/graphs/ApyGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type FormattedReserveHistoryItem = {
/**
* Formats the given date for the specified time range to display in the tooltip.
*
* If the provided timeRange is '1m', the date will be formatted as 'MM DD, HH:MM UTC'.
* If the provided timeRange is '1d' or '1m', the date will be formatted as 'MM DD, HH:MM UTC'.
* For example, a date of `Wed Sep 21 2022 18:00:00 GMT-0500 (Central Daylight Time)` will be formatted as `Sep 21, 18:00 UTC-05:00`
*
* If the provided timeRange is '6m' or '1y', the date will be formatted as 'MM DD, YYYY'.
Expand All @@ -33,7 +33,7 @@ export type FormattedReserveHistoryItem = {
*
*/
const formatDate = (d: Date, timeRange: TimeWindow) => {
if (timeRange === TimeWindow.LastMonth) {
if (timeRange === TimeWindow.LastDay || timeRange === TimeWindow.LastMonth) {
const formatted = timeFormat('%b %d, %H:%M UTC%Z');
const date = formatted(d);
const offsetSign = date.toString().split('UTC')[1].split('')[0];
Expand Down
4 changes: 2 additions & 2 deletions src/modules/reserve-overview/graphs/ApyGraphContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type ApyGraphProps = {
};

export const SupplyApyGraph = ({ chain, underlyingToken, market }: ApyGraphProps) => {
const [selectedTimeRange, setSelectedTimeRange] = useState<TimeWindow>(TimeWindow.LastWeek);
const [selectedTimeRange, setSelectedTimeRange] = useState<TimeWindow>(TimeWindow.LastDay);
const { palette } = useTheme();

const { data, loading, error } = useSupplyAPYHistory({
Expand All @@ -66,7 +66,7 @@ export const SupplyApyGraph = ({ chain, underlyingToken, market }: ApyGraphProps
};

export const BorrowApyGraph = ({ chain, underlyingToken, market }: ApyGraphProps) => {
const [selectedTimeRange, setSelectedTimeRange] = useState<TimeWindow>(TimeWindow.LastWeek);
const [selectedTimeRange, setSelectedTimeRange] = useState<TimeWindow>(TimeWindow.LastDay);
const { palette } = useTheme();

const { data, loading, error } = useBorrowAPYHistory({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const GraphTimeRangeSelector = ({
<TimeRangeSelector
disabled={disabled}
timeRanges={[
TimeWindow.LastDay,
TimeWindow.LastWeek,
TimeWindow.LastMonth,
TimeWindow.LastSixMonths,
Expand Down