mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
ensure pikaday respects our color scheme
This commit is contained in:
@@ -9,24 +9,28 @@ export default Em.Component.extend({
|
||||
@on("didInsertElement")
|
||||
_loadDatePicker() {
|
||||
const input = this.$(".date-picker")[0];
|
||||
const container = $("#" + this.get("containerId"))[0];
|
||||
|
||||
loadScript("/javascripts/pikaday.js").then(() => {
|
||||
let default_opts = {
|
||||
field: input,
|
||||
container: this.$()[0],
|
||||
format: "YYYY-MM-DD",
|
||||
firstDay: moment.localeData().firstDayOfWeek(),
|
||||
i18n: {
|
||||
previousMonth: I18n.t('dates.previous_month'),
|
||||
nextMonth: I18n.t('dates.next_month'),
|
||||
months: moment.months(),
|
||||
weekdays: moment.weekdays(),
|
||||
weekdaysShort: moment.weekdaysShort()
|
||||
},
|
||||
onSelect: date => this.set("value", moment(date).format("YYYY-MM-DD"))
|
||||
};
|
||||
Ember.run.next(() => {
|
||||
let default_opts = {
|
||||
field: input,
|
||||
container: container || this.$()[0],
|
||||
bound: container === undefined,
|
||||
format: "YYYY-MM-DD",
|
||||
firstDay: moment.localeData().firstDayOfWeek(),
|
||||
i18n: {
|
||||
previousMonth: I18n.t('dates.previous_month'),
|
||||
nextMonth: I18n.t('dates.next_month'),
|
||||
months: moment.months(),
|
||||
weekdays: moment.weekdays(),
|
||||
weekdaysShort: moment.weekdaysShort()
|
||||
},
|
||||
onSelect: date => this.set("value", moment(date).format("YYYY-MM-DD"))
|
||||
};
|
||||
|
||||
this._picker = new Pikaday(_.merge(default_opts, this._opts()));
|
||||
this._picker = new Pikaday(_.merge(default_opts, this._opts()));
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
<input class="date-picker">
|
||||
<input type="text" class="date-picker">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal-body">
|
||||
<div class="modal-body change-timestamp">
|
||||
<p>
|
||||
{{i18n 'topic.change_timestamp.instructions'}}
|
||||
</p>
|
||||
@@ -8,9 +8,11 @@
|
||||
</p>
|
||||
|
||||
<form>
|
||||
{{input type="date" value=date}}
|
||||
{{date-picker-past value=date containerId="date-container"}}
|
||||
{{input type="time" value=time}}
|
||||
</form>
|
||||
|
||||
<div id="date-container" />
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
|
||||
Reference in New Issue
Block a user