Skip to content

[ITEP-19820] Infra UI Maintainance List - Invalid Date Bug Safari #29

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

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

RPG-coder-intc
Copy link
Contributor

@RPG-coder-intc RPG-coder-intc commented Apr 7, 2025

This bug is only reproducible in Safari (Mac OS) browser:

Reason:

Javascript Date() in safari doesnot recognize date substitution of format 30/Jun/2023. This value is converted from the Unix timestamp getDateTimeFromSeconds in single schedule maintenance.

Fix:

Instead 30-Jun-2023 is valid JS format in both safari and chrome.

ref: https://stackoverflow.com/questions/4310953/invalid-date-in-safari

After fix

image

This is tested on chrome (windows)

  • To be Tested in Mac OS safari browser & chrome browser ...

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • apps/infra/src/components/organism/RepeatedScheduleMaintenanceForm/RepeatedScheduleMaintenance.scss: Language not supported

@RPG-coder-intc RPG-coder-intc marked this pull request as ready for review April 7, 2025 18:35
@RPG-coder-intc
Copy link
Contributor Author

RPG-coder-intc commented Apr 7, 2025

@teone, i may need a mac os to test this code :)

Comment on lines +8 to +11

.flex-item {
overflow: visible;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the dropdown for repeat date, repeat day, and repeat month selection is hidden due to the new <Flex /> component.

@RPG-coder-intc RPG-coder-intc added the ready-for-review This PR has been validated on a running setup and is ready for review and merge label Apr 7, 2025
teone pushed a commit that referenced this pull request Apr 8, 2025
@RPG-coder-intc RPG-coder-intc removed the ready-for-review This PR has been validated on a running setup and is ready for review and merge label Apr 9, 2025
@RPG-coder-intc RPG-coder-intc marked this pull request as draft April 15, 2025 17:00
@RPG-coder-intc RPG-coder-intc marked this pull request as ready for review April 16, 2025 21:41
@@ -184,7 +184,8 @@ export const getHumanReadableDuration = (durationSeconds: number) => {
/** Convert date-time in seconds format to `date, hh, mm` format */
export const getDateTimeFromSeconds = (seconds: number) => {
const dateString = new Date(seconds * 1000).toUTCString().split(" ");
const date = [dateString[1], dateString[2], dateString[3]].join("/");
// this will return date in `30-Jun-2023` format (which is supported in safari and chrome)
const date = [dateString[1], dateString[2], dateString[3]].join("-");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note previously this was returning 30/Jun/2023 which was not supported in safari macOs

@RPG-coder-intc RPG-coder-intc requested a review from teone April 16, 2025 21:53
Copy link
Member

@teone teone left a comment

Choose a reason for hiding this comment

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

This was discussed last week. While this fix works in Safari (I just verified) we have the opportunity to cleanup this code.

Screenshot 2025-04-16 at 3 03 26 PM

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.

2 participants