feat(events): get range date of calendar
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2021-11-08 11:30:00 +01:00
parent 3324f4acd2
commit 6e2f7d9e0d
3 changed files with 12 additions and 9 deletions

View File

@ -43,7 +43,7 @@ module.exports = Self => {
)
)
)
ORDER BY type='indefinitely',type='range',type='day';`;
ORDER BY type='indefinitely' DESC, type='range' DESC, type='day' DESC;`;
const events = await Self.rawSql(query, [zoneFk, started, ended, started, ended, started, ended]);
query = `

View File

@ -1,5 +1,6 @@
<vn-zone-calendar
id="calendar"
vn-id="calendar"
data="data"
on-selection="$ctrl.onSelection($days, $type, $weekday, $events, $exclusions)"
class="vn-w-md">

View File

@ -22,15 +22,17 @@ class Controller extends Section {
refresh() {
this.$.data = null;
let params = {
zoneFk: 10,
started: new Date('2021-10-01'),
ended: new Date('2022-02-31')
};
this.$.$applyAsync(() => {
const params = {
zoneFk: this.$params.id,
started: this.$.calendar.firstDay,
ended: this.$.calendar.lastDay
};
this.$http.get(`Zones/getEventsFiltered`, {params}).then(res => {
let data = res.data;
this.$.data = data;
this.$http.get(`Zones/getEventsFiltered`, {params}).then(res => {
const data = res.data;
this.$.data = data;
});
});
}