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: Git History Date bug #1585

Merged

Conversation

activcoding
Copy link
Member

  • Correct date isn't displayed in this history tab

  • Branch image was slightly to big, compared to Xcode

  • Branch menu color was a bit off

  • Branch menu indicator wasn't hidden

Description

The commit date in the history tab wasn't displayed correctly. Additionally, the git branch menu had a few issues, including discrepancies in color, indicator visibility, and branch symbol size.

Related Issues

na

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

Before:
Screenshot 2024-02-03 at 9 28 35 PM
Now:
Screenshot 2024-02-03 at 9 27 37 PM
Before:
Screenshot 2024-02-03 at 9 03 34 PM
Now:
Screenshot 2024-02-03 at 9 26 03 PM
When hovering:
Screenshot 2024-02-03 at 9 26 07 PM

- Correct date isn't displayed in this history tab

- Branch image was slightly to big, compared to Xcode

- Branch menu color was a bit off

- Branch menu indicator wasn't hidden
@activcoding
Copy link
Member Author

Could you please check which line works better in GitClient+CommitHistory.swift:

dateFormatter.locale = Locale(identifier: Locale.current.identifier)

or:

dateFormatter.locale = Locale(identifier: "en_US_POSIX")

Both should work.

thecoolwinter
thecoolwinter previously approved these changes Feb 3, 2024
@thecoolwinter
Copy link
Collaborator

Actually I have no issues with just Locale.current there, is that the problem? I'm fairly certain Locale(identifier: Locale.current.identifier) would resolve to the same thing.

@activcoding
Copy link
Member Author

It seems like Locale.current behaves differently outside the US. I tested all three options on my machine, and only using Locale.current resulted in a nil date. Austin had no issues with any option when testing the same code. Both approaches work for me, but I prefer Locale(identifier: Locale.current.identifier).

dateFormatter.locale = Locale(identifier: Locale.current.identifier)
dateFormatter.locale = Locale(identifier: "en_US_POSIX")

If you're okay with using Locale(identifier: Locale.current.identifier), we can just stick with that.

@thecoolwinter
Copy link
Collaborator

Okay! Yeah let's go with that, seems better than a hardcoded value.

@matthijseikelenboom matthijseikelenboom merged commit 779d624 into CodeEditApp:main Feb 7, 2024
2 checks passed
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.

None yet

3 participants