add hours as sorting options
authorIvo Barros <devL3v3L@gmail.com>
Sat, 17 Jun 2023 08:37:03 +0000 (09:37 +0100)
committerIvo Barros <devL3v3L@gmail.com>
Sat, 17 Jun 2023 08:37:03 +0000 (09:37 +0100)
src/shared/components/common/sort-select.tsx
src/shared/utils.ts

index dac6e20d51723fda24763c34e3fa9f3eceb3dd3f..1fd320767f45cfcde01e115db7b7bfa519f601d8 100644 (file)
@@ -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>
index c7fbca6b5654db597b098c452af5dc6ed522273b..abb306290c637768b1c1a3ecba42a3e95f95f376 100644 (file)
@@ -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" ||