Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: life event creation with unknown month/day #6046

Merged
merged 1 commit into from
Mar 8, 2022

Conversation

particleflux
Copy link

@particleflux particleflux commented Mar 7, 2022

This is a JS problem, current version sends this on create:

happened_at	"2022-0-0"
happened_at_day_unknown	false
happened_at_month_unknown	false

Whereas old version sent this:

happened_at	"2022-1-1"
happened_at_day_unknown	true
happened_at_month_unknown	true

This issue was introduced by 57b31f6

The strict comparison added in the updateDate function in CreateLifeEvent.vue broke it.
The values for this.selectedMonth and this.selectedDay can be numbers/integers or strings, depending on where they come from.
Initial values and values set by JS are numbers, whereas values set by user input are strings.

Fixes #5936

I guess there might be a nicer approach to this in vue, or in general, though I don't have an idea :)

This is a JS problem, current version sends this on create:

```
happened_at	"2022-0-0"
happened_at_day_unknown	false
happened_at_month_unknown	false
```

Whereas old version sent this:
```
happened_at	"2022-1-1"
happened_at_day_unknown	true
happened_at_month_unknown	true
```

This issue was introduced by 57b31f6

The strict comparison added in the `updateDate` function in CreateLifeEvent.vue broke it.
The values for `this.selectedMonth` and `this.selectedDay` can be numbers/integers or strings, depending on where they come from.
Initial values and values set by JS are numbers, whereas values set by user input are strings.

Fixes monicahq#5936
@asbiin asbiin merged commit d81123b into monicahq:main Mar 8, 2022
@asbiin
Copy link
Member

asbiin commented Mar 8, 2022

Good catch, thank you @particleflux

@particleflux particleflux deleted the fix-issue-5936 branch March 8, 2022 16:18
@github-actions
Copy link

🎉 This PR is included in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

github-actions bot commented Feb 1, 2024

This pull request has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to add life event without specifying a day and month
2 participants