2019-04-11 17:14:34 +08:00
|
|
|
import ComboBoxComponent from "select-kit/components/combo-box";
|
2020-02-03 21:22:14 +08:00
|
|
|
import { computed } from "@ember/object";
|
2019-04-11 17:14:34 +08:00
|
|
|
|
|
|
|
export default ComboBoxComponent.extend({
|
|
|
|
pluginApiIdentifiers: ["timezone-input"],
|
2020-02-03 21:22:14 +08:00
|
|
|
classNames: ["timezone-input"],
|
|
|
|
nameProperty: null,
|
|
|
|
valueProperty: null,
|
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
|
|
|
|
2020-02-03 21:22:14 +08:00
|
|
|
content: computed(function() {
|
2019-04-11 17:14:34 +08:00
|
|
|
if (
|
|
|
|
moment.locale() !== "en" &&
|
|
|
|
typeof moment.tz.localizedNames === "function"
|
|
|
|
) {
|
2020-02-03 21:22:14 +08:00
|
|
|
return moment.tz.localizedNames().mapBy("value");
|
|
|
|
} else {
|
|
|
|
return moment.tz.names();
|
2019-04-11 17:14:34 +08:00
|
|
|
}
|
2020-02-03 21:22:14 +08:00
|
|
|
})
|
2019-04-11 17:14:34 +08:00
|
|
|
});
|