UX: full revamp of local-dates form (#7357)

This commit is contained in:
Joffrey JAFFEUX
2019-04-11 11:14:34 +02:00
committed by GitHub
parent 110512d4d0
commit 7226240df3
5 changed files with 352 additions and 167 deletions

View File

@ -0,0 +1,31 @@
import ComboBoxComponent from "select-kit/components/combo-box";
import { default as computed } from "ember-addons/ember-computed-decorators";
export default ComboBoxComponent.extend({
pluginApiIdentifiers: ["timezone-input"],
classNames: "timezone-input",
allowAutoSelectFirst: false,
fullWidthOnMobile: true,
filterable: true,
allowAny: false,
@computed
content() {
let timezones;
if (
moment.locale() !== "en" &&
typeof moment.tz.localizedNames === "function"
) {
timezones = moment.tz.localizedNames();
}
timezones = moment.tz.names();
return timezones.map(t => {
return {
id: t,
name: t
};
});
}
});