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