Skip to content

Commit

Permalink
Fixes addEvent and updateEvent returns (#303)
Browse files Browse the repository at this point in the history
* addEvent and updateEvent return fix.

* rollup config fix.
  • Loading branch information
rrimsa committed Jul 29, 2024
1 parent 1ec763b commit c011eea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions packages/core/src/Calendar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,23 @@
}
export function addEvent(event) {
$_events.push(createEvents([event])[0]);
const ev = createEvents([event])[0]
$_events.push(ev);
$_events = $_events;
return this;
return ev;
}
export function updateEvent(event) {
let ev = null
for (let e of $_events) {
if (e.id == event.id) {
assign(e, createEvents([event])[0]);
ev = createEvents([event])[0]
assign(e, ev);
$_events = $_events;
break;
}
}
return this;
return ev;
}
export function removeEventById(id) {
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import postcss from 'postcss';
import autoprefixer from 'autoprefixer';
import cssnano from 'cssnano';
import {writeFileSync} from 'fs';
import pkg from './package.json' assert {type: 'json'};
import pkg from './package.json' with {type: 'json'};
import {spawn} from 'child_process';

const production = !process.env.ROLLUP_WATCH;
Expand Down

0 comments on commit c011eea

Please sign in to comment.