diff --git a/packages/bbui/src/Form/Core/DatePicker.svelte b/packages/bbui/src/Form/Core/DatePicker.svelte index 6f91890d61..2ff123d353 100644 --- a/packages/bbui/src/Form/Core/DatePicker.svelte +++ b/packages/bbui/src/Form/Core/DatePicker.svelte @@ -41,7 +41,7 @@ time_24hr: time24hr || false, altFormat: timeOnly ? "H:i" : enableTime ? "F j Y, H:i" : "F j, Y", wrap: true, - mode: "range" || null, + mode: range ? "range" : null, appendTo, disableMobile: "true", onReady: () => { @@ -62,12 +62,13 @@ const [dates] = event.detail const noTimezone = enableTime && !timeOnly && ignoreTimezones let newValue = dates[0] + if (newValue) { newValue = newValue.toISOString() } // If time only set date component to 2000-01-01 - if (timeOnly) { + else if (timeOnly) { // Classic flackpickr causing issues. // When selecting a value for the first time for a "time only" field, // the time is always offset by 1 hour for some reason (regardless of time @@ -94,8 +95,9 @@ newValue = new Date(dates[0].getTime() - offset) .toISOString() .slice(0, -1) + } else if (range) { + console.log("hello") } - dispatch("change", newValue) } diff --git a/packages/builder/src/components/portal/overview/backups/ActionsRenderer.svelte b/packages/builder/src/components/portal/overview/backups/ActionsRenderer.svelte index b302b99d53..c43a78c437 100644 --- a/packages/builder/src/components/portal/overview/backups/ActionsRenderer.svelte +++ b/packages/builder/src/components/portal/overview/backups/ActionsRenderer.svelte @@ -4,17 +4,21 @@ ActionMenu, MenuItem, Icon, + Input, Heading, Body, } from "@budibase/bbui" import ConfirmDialog from "components/common/ConfirmDialog.svelte" import { createEventDispatcher } from "svelte" + import download from "downloadjs" + import { backups } from "stores/portal" export let row let deleteDialog let restoreDialog - + let updateDialog + let name let restoreBackupName const dispatch = createEventDispatcher() @@ -33,6 +37,21 @@ backupId: row._id, }) } + + const onClickUpdate = () => { + dispatch("buttonclick", { + type: "backupUpdate", + backupId: row._id, + name, + }) + } + async function downloadExport() { + let resp = await backups.downloadBackup({ + backupId: row._id, + appId: row.appId, + }) + download(resp, row.filename) + }