@ -8,14 +8,12 @@ module.exports = class {
error: null,
loading: false,
values: {
time: moment.utc(new Date()).format("YYYY-MM-DD HH:mm:ss"),
time: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"),
kind: "text",
nick: "",
text: "",
},
}
this.first = false
change(key, ev) {
@ -23,10 +21,10 @@ module.exports = class {
open() {
this.state.values.time = moment(new Date()).format("YYYY-MM-DD HH:mm:ss")
close() {
this.emit("close")
@ -37,7 +35,7 @@ module.exports = class {
const values = this.state.values
let time = new Date(values.time + " UTC")
let time = new Date(values.time)
if (Number.isNaN(time)) {
this.state.error = `Could not parse ${values.time} as date`
return
@ -17,7 +17,7 @@
</select>
<label>Nick</label>
<input key="nick" placeholder="IRC_Nick (You can use non-IRC letters here, like ', but I recommend you don't so the character is found)" class="big" on-change("change", "nick") value=state.values.nick />
<input key="nick" placeholder="IRC_Nick" class="big" on-change("change", "nick") value=state.values.nick />
<label>Text</label>
<textarea key="text" placeholder="Text" class="tall" on-change("change", "text") value=state.values.text />
@ -21,7 +21,7 @@ module.exports = class {
onInput(input) {
if (input.post) {
const {kind, nick, text} = input.post
const time = moment.utc(input.post.time).format("YYYY-MM-DD HH:mm:ss")
const time = moment(input.post.time).format("YYYY-MM-DD HH:mm:ss")
this.state.values = {time, kind, nick, text}
@ -46,7 +46,7 @@ module.exports = class {