Skip to content
Snippets Groups Projects
Unverified Commit 75d5c783 authored by Gustavo Saiani's avatar Gustavo Saiani Committed by GitHub
Browse files

Remove deprecated function formatDay (#24384)

parent fa03bc71
Branches
Tags
No related merge requests found
......@@ -101,28 +101,6 @@ export function parseTime(value) {
return moment.utc(value);
}
// @deprecated use formatDateTimeWithUnit(day, "day-of-week")
export function formatDay(day) {
switch (day) {
case "mon":
return t`Monday`;
case "tue":
return t`Tuesday`;
case "wed":
return t`Wednesday`;
case "thu":
return t`Thursday`;
case "fri":
return t`Friday`;
case "sat":
return t`Saturday`;
case "sun":
return t`Sunday`;
default:
return day;
}
}
export function formatFrame(frame) {
switch (frame) {
case "first":
......
......@@ -14,8 +14,11 @@ import Subhead from "metabase/components/type/Subhead";
import Sidebar from "metabase/dashboard/components/Sidebar";
import Tooltip from "metabase/components/Tooltip";
import { formatTimeWithUnit } from "metabase/lib/formatting";
import { formatDay, formatFrame } from "metabase/lib/time";
import {
formatDateTimeWithUnit,
formatTimeWithUnit,
} from "metabase/lib/formatting";
import { formatFrame } from "metabase/lib/time";
import { getActivePulseParameters } from "metabase/lib/pulse";
import { getParameters } from "metabase/dashboard/selectors";
......@@ -250,13 +253,15 @@ function friendlySchedule(channel) {
}
case "weekly": {
const hour = formatTimeWithUnit(schedule_hour, "hour-of-day");
const day = formatDay(schedule_day);
const day = formatDateTimeWithUnit(schedule_day, "day-of-week");
scheduleString += t`${day} at ${hour}`;
break;
}
case "monthly": {
const hour = formatTimeWithUnit(schedule_hour, "hour-of-day");
const day = schedule_day ? formatDay(schedule_day) : "calendar day";
const day = schedule_day
? formatDateTimeWithUnit(schedule_day, "day-of-week")
: "calendar day";
const frame = formatFrame(schedule_frame);
scheduleString += t`monthly on the ${frame} ${day} at ${hour}`;
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment