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

Remove unused function (#24158)

parent 80e3f47e
No related branches found
No related tags found
No related merge requests found
......@@ -100,13 +100,6 @@ function mapToMomentLocale(locale = "") {
}
}
// Format a fixed timestamp in local time to see if the current locale defaults
// to using a 24 hour clock.
export function isLocale24Hour() {
const formattedTime = moment("2000-01-01T13:00:00").format("LT");
return /^13:/.test(formattedTime);
}
// we delete msgid property since it's redundant, but have to add it back in to
// make ttag happy
function addMsgIds(translationsObject) {
......
import moment from "moment-timezone";
import { isLocale24Hour } from "metabase/lib/i18n";
describe("isLocale24Hour", () => {
const testCases = [
["en", false],
["en-us", false],
["en-gb", true],
["fr", true],
["zh-cn", true],
];
for (const [locale, is24] of testCases) {
it(`should return ${is24} for '${locale}'`, () => {
// save locale before changing it
const startingLocale = moment.locale();
moment.locale(locale);
expect(isLocale24Hour()).toBe(is24);
// reset locale
moment.locale(startingLocale);
});
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment