Skip to content

Conversation

@Malwine
Copy link
Owner

@Malwine Malwine commented Jan 18, 2024

This PR implements version 2. A user can now start and finish a routine on button click.
This new iteration is not yet saved persistently. I still need to decide how to move on with saving data.

@vercel
Copy link

vercel bot commented Jan 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
routines ✅ Ready (Inspect) Visit Preview Jan 18, 2024 8:28pm

@Malwine Malwine requested a review from schultyy January 18, 2024 20:29
Copy link
Collaborator

@schultyy schultyy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm the only thing I'd be wondering about is that you store dates as string right now.

if (runningRoutine) {
runningRoutine.running = false;
let currentDate = new Date();
runningRoutine.end = currentDate.toISOString();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you saving the end date as a string? What speaks against saving it as date time?


if (!runningRoutine) {
let currentDate = new Date();
let newRoutine = {"start": currentDate.toISOString(), "running": true};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here as down below - what about storing start as Date instead of String?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants