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

Allow to edit taken_at date #2954

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Allow to edit taken_at date #2954

wants to merge 1 commit into from

Conversation

ildyria
Copy link
Member

@ildyria ildyria commented Jan 24, 2025

by popular demand.

Fixes #2537

Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.71%. Comparing base (79fada4) to head (ac89779).

Additional details and impacted files

@ildyria ildyria marked this pull request as ready for review January 25, 2025 19:00
@ildyria ildyria requested a review from a team as a code owner January 25, 2025 19:00
@ildyria ildyria added the Review: easy Easy review expected: probably just need a quick to go through. label Jan 25, 2025
@ildyria
Copy link
Member Author

ildyria commented Jan 25, 2025

After further thoughts, this is not the fully correct approach. There is one problem: the set taken_at date does not will not be considered for sorting etc. This somewhat defeats the purpose of the functionality.

I considered using taken_at_mod to store the original taken at date, but unfortunately changing the date twice would make this old non-existing date (null) gone.

Considering a third approach would require both taken_at_origin and a boolean is_exif_taken_at...

@ildyria
Copy link
Member Author

ildyria commented Jan 26, 2025

After further thoughts, this is not the fully correct approach. There is one problem: the set taken_at date does not will not be considered for sorting etc. This somewhat defeats the purpose of the functionality.

I considered using taken_at_mod to store the original taken at date, but unfortunately changing the date twice would make this old non-existing date (null) gone.

Considering a third approach would require both taken_at_origin and a boolean is_exif_taken_at...

Fixed.

@ildyria ildyria force-pushed the allow-edit-camera-date branch from e65664c to ac89779 Compare January 26, 2025 16:01
Copy link
Contributor

@sancsin sancsin left a comment

Choose a reason for hiding this comment

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

Should we also allow changing the timezone? Right now we can only edit the time, what if there is also timezone information that user wants to edit?

Comment on lines +139 to +140
const takenDate = (photo.taken_at ?? "").slice(0, 16);
takenAtTz.value = (photo.taken_at ?? "").slice(16);
Copy link
Contributor

Choose a reason for hiding this comment

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

should it be slice(0,19) instead? Date format is of type 2021-01-01T00:00:00+00:00 as I understood. And the timezone information is starting at "+" character which is at 19th character location.

Comment on lines 134 to 135
const dataDate = (photo.created_at ?? "").slice(0, 16);
uploadTz.value = (photo.created_at ?? "").slice(16);
Copy link
Contributor

Choose a reason for hiding this comment

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

should it be slice(0,19) instead? Date format is of type 2021-01-01T00:00:00+00:00 as I understood. And the timezone information is starting at "+" character which is at 19th character location.

Comment on lines +151 to +152
const takenDate = takenAtDate.value === undefined ? null : takenAtDate.value.toISOString().slice(0, 16) + takenAtTz.value;

Copy link
Contributor

Choose a reason for hiding this comment

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

slice(0,19)?

@sancsin
Copy link
Contributor

sancsin commented Jan 27, 2025

Looking good and user friendly! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review: easy Easy review expected: probably just need a quick to go through.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants