mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 06:53:40 +08:00
febe997bee
This also switches to using the NPM package for better build stability. And adds a clearer label in the alert that is displayed to show your current timezone (when changing timezones).
30 lines
642 B
JavaScript
30 lines
642 B
JavaScript
import ComboBoxComponent from "select-kit/components/combo-box";
|
|
|
|
export default ComboBoxComponent.extend({
|
|
pluginApiIdentifiers: ["timezone-input"],
|
|
classNames: ["timezone-input"],
|
|
|
|
selectKitOptions: {
|
|
filterable: true,
|
|
allowAny: false,
|
|
},
|
|
|
|
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"
|
|
);
|
|
},
|
|
});
|