Skip to content

Commit

Permalink
Fix announcement center time selector not showing half hour increments
Browse files Browse the repository at this point in the history
  • Loading branch information
anoek committed May 20, 2024
1 parent 71a96c9 commit f1a68be
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/views/AnnouncementCenter/AnnouncementCenter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import * as React from "react";
import * as data from "data";
import { _, pgettext } from "translate";
import { _, interpolate, pgettext } from "translate";
import { post, get, del } from "requests";
import { PaginatedTable } from "PaginatedTable";
import { Card } from "material";
Expand Down Expand Up @@ -170,9 +170,14 @@ export function AnnouncementCenter(): JSX.Element {
}}
/>
<span className="text">
{moment
.duration(duration_options[duration_idx], "seconds")
.humanize(false, { h: 24, m: 59, s: 59 })}
{duration_options[duration_idx] > 3600 &&
duration_options[duration_idx] % 3600 === 1800
? interpolate(_("%s hours"), [
(duration_options[duration_idx] / 3600).toFixed(1),
])
: moment
.duration(duration_options[duration_idx], "seconds")
.humanize(false, { h: 24, m: 59, s: 59 })}
</span>
</div>
</dd>
Expand Down

0 comments on commit f1a68be

Please sign in to comment.