Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature add hours as sorting options frontend #1345

Merged
merged 15 commits into from
Jun 22, 2023
3 changes: 3 additions & 0 deletions src/shared/components/common/sort-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ export class SortSelect extends Component<SortSelectProps, SortSelectState> {
<option disabled aria-hidden="true">
─────
</option>
<option value={"TopHour"}>{i18n.t("top_hour")}</option>
<option value={"TopSixHour"}>{i18n.t("top_six_hours")}</option>
<option value={"TopTwelveHour"}>{i18n.t("top_twelve_hours")}</option>
<option value={"TopDay"}>{i18n.t("top_day")}</option>
<option value={"TopWeek"}>{i18n.t("top_week")}</option>
<option value={"TopMonth"}>{i18n.t("top_month")}</option>
Expand Down
3 changes: 3 additions & 0 deletions src/shared/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,9 @@ export function commentsToFlatNodes(comments: CommentView[]): CommentNodeI[] {
export function convertCommentSortType(sort: SortType): CommentSortType {
if (
sort == "TopAll" ||
sort == "TopHour" ||
sort == "TopSixHour" ||
sort == "TopTwelveHour" ||
sort == "TopDay" ||
sort == "TopWeek" ||
sort == "TopMonth" ||
L3v3L marked this conversation as resolved.
Show resolved Hide resolved
Expand Down