2019-04-11 17:14:34 +08:00
|
|
|
import ComboBoxComponent from "select-kit/components/combo-box";
|
|
|
|
|
|
|
|
export default ComboBoxComponent.extend({
|
|
|
|
pluginApiIdentifiers: ["timezone-input"],
|
2020-02-03 21:22:14 +08:00
|
|
|
classNames: ["timezone-input"],
|
2019-04-11 17:14:34 +08:00
|
|
|
|
2020-02-03 21:22:14 +08:00
|
|
|
selectKitOptions: {
|
|
|
|
filterable: true,
|
|
|
|
allowAny: false,
|
|
|
|
},
|
2019-04-11 17:14:34 +08:00
|
|
|
|
2022-02-03 06:41:42 +08:00
|
|
|
get nameProperty() {
|
|
|
|
return this.isLocalized ? "name" : null;
|
|
|
|
},
|
|
|
|
|
|
|
|
get valueProperty() {
|
|
|
|
return this.isLocalized ? "value" : null;
|
|
|
|
},
|
|
|
|
|
|
|
|
get content() {
|
|
|
|
return this.isLocalized ? moment.tz.localizedNames() : moment.tz.names();
|
|
|
|
},
|
|
|
|
|
|
|
|
get isLocalized() {
|
|
|
|
return (
|
|
|
|
moment.locale() !== "en" && typeof moment.tz.localizedNames === "function"
|
|
|
|
);
|
|
|
|
},
|
2019-04-11 17:14:34 +08:00
|
|
|
});
|