Compare commits

..

No commits in common. "923f5ec27cd84fb22212afee34c57234484783fb" and "38480a1eec2c45fb6ede7fb27166e6f47b5e97fc" have entirely different histories.

4 changed files with 12 additions and 20 deletions

View File

@ -1,6 +1,6 @@
[metadata] [metadata]
license = MIT license = MIT
version = 1.0.0 version = 1.0.0-alpha.9
name = flaschengeist-events name = flaschengeist-events
description = Events plugin for Flaschengeist description = Events plugin for Flaschengeist
url = https://flaschengeist.dev/Flaschengeist/flaschengeist-schedule url = https://flaschengeist.dev/Flaschengeist/flaschengeist-schedule
@ -24,7 +24,7 @@ python_requires = >=3.8
packages = packages =
flaschengeist_events flaschengeist_events
install_requires = install_requires =
flaschengeist >= 2.0.0 flaschengeist >= 2.0.0.dev0
[options.package_data] [options.package_data]
* = *.toml, script.py.mako, *.ini, migrations/*.py * = *.toml, script.py.mako, *.ini, migrations/*.py

View File

@ -1,6 +1,6 @@
{ {
"license": "MIT", "license": "MIT",
"version": "1.0.0", "version": "1.0.0-alpha.9",
"name": "@flaschengeist/schedule", "name": "@flaschengeist/schedule",
"author": "Ferdinand Thiessen <rpm@fthiessen.de>", "author": "Ferdinand Thiessen <rpm@fthiessen.de>",
"homepage": "https://flaschengeist.dev/Flaschengeist", "homepage": "https://flaschengeist.dev/Flaschengeist",
@ -22,8 +22,8 @@
"@quasar/quasar-ui-qcalendar": "^4.0.0-beta.11" "@quasar/quasar-ui-qcalendar": "^4.0.0-beta.11"
}, },
"devDependencies": { "devDependencies": {
"@flaschengeist/api": "^1.0.0", "@flaschengeist/api": "^1.0.0-alpha.8",
"@flaschengeist/types": "^1.0.0", "@flaschengeist/types": "^1.0.0-alpha.10",
"@quasar/app-webpack": "^3.7.2", "@quasar/app-webpack": "^3.7.2",
"@typescript-eslint/eslint-plugin": "^5.8.0", "@typescript-eslint/eslint-plugin": "^5.8.0",
"@typescript-eslint/parser": "^5.8.0", "@typescript-eslint/parser": "^5.8.0",
@ -38,8 +38,8 @@
"typescript": "^4.5.4" "typescript": "^4.5.4"
}, },
"peerDependencies": { "peerDependencies": {
"@flaschengeist/api": "^1.0.0", "@flaschengeist/api": "^1.0.0-alpha.8",
"@flaschengeist/users": "^1.0.0" "@flaschengeist/users": "^1.0.0-alpha.4"
}, },
"prettier": { "prettier": {
"singleQuote": true, "singleQuote": true,

View File

@ -183,7 +183,7 @@ export default defineComponent({
} }
function fromTemplate(tpl: FG.Event) { function fromTemplate(tpl: FG.Event) {
const today = props.modelValue?.start || new Date(); const today = new Date();
template.value = tpl; template.value = tpl;
event.value = Object.assign({}, tpl, { id: undefined }); event.value = Object.assign({}, tpl, { id: undefined });
@ -199,16 +199,9 @@ export default defineComponent({
if (event.value.end) event.value.end.setTime(event.value.end.getTime() + diff); if (event.value.end) event.value.end.setTime(event.value.end.getTime() + diff);
event.value.jobs = []; event.value.jobs = [];
tpl.jobs.forEach((job) => { tpl.jobs.forEach((job) => {
const copied_job: FG.Job = Object.assign({}, job, { const copied_job: FG.Job = Object.assign({}, job, { id: NaN });
id: NaN, copied_job.start.setTime(copied_job.start.getTime() + diff);
start: new Date(), if (copied_job.end) copied_job.end.setTime(copied_job.end.getTime() + diff);
end: undefined,
});
copied_job.start.setTime(job.start.getTime() + diff);
if (job.end) {
copied_job.end = new Date();
copied_job.end.setTime(job.end.getTime() + diff);
}
event.value.jobs.push(<Job>copied_job); event.value.jobs.push(<Job>copied_job);
}); });
} }
@ -299,7 +292,6 @@ export default defineComponent({
const diff = newValue.getTime() - oldValue.getTime(); const diff = newValue.getTime() - oldValue.getTime();
event.value?.jobs.forEach((job) => { event.value?.jobs.forEach((job) => {
job.start.setTime(job.start.getTime() + diff); job.start.setTime(job.start.getTime() + diff);
job.end?.setTime(job.end.getTime() + diff);
}); });
computed_end.value?.setTime(computed_end.value?.getTime() + diff); computed_end.value?.setTime(computed_end.value?.getTime() + diff);
setTimeout(() => { setTimeout(() => {

View File

@ -235,7 +235,7 @@ export default defineComponent({
'November', 'November',
'Dezember', 'Dezember',
'-', '-',
][value?.getMonth() === 0 ? 0 : value?.getMonth() || 12]; ][value?.getMonth() || 12];
} }
function asYear(value?: Date) { function asYear(value?: Date) {
return value?.getFullYear() || '-'; return value?.getFullYear() || '-';