const ViewDates = { data () { return { edit: { id: 0, }, form: false, list: [], } }, created () { self = this self.refresh(); }, watch: { '$route': 'refresh' }, methods: { refresh() { getJSON(`//${location.host}${location.pathname}api/date`).then(function(data){ self.list = data; }) }, openAdd() { self.form = true; self.edit.id = 0; }, send() { if (self.edit.id === 0) { httpJSON(`//${location.host}${location.pathname}api/date`,'POST', '"' + new Date(self.edit.date).toISOString() + '"') .then(function(data) { self.refresh(); self.form = false; }, function (err) { alert("unable to add new date:" + err.message); }) } }, personen (date) { return 0; } }, template: `

Termine

Datum Personen
{{ new Date(item.date).toDateString() }} {{ personen(item) }}
`, }