-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: adjust start & end of event when system timezone is using DST #1222
Conversation
@@ -32,7 +32,7 @@ export function calculateTimezoneOffset(timezoneName: string, targetDate: TZDate | |||
'Intl.DateTimeFormat is not fully supported. So It will return the local timezone offset only.\nYou can use a polyfill to fix this issue.' | |||
); | |||
|
|||
return -targetDate.getTimezoneOffset(); | |||
return -targetDate.toDate().getTimezoneOffset(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TZDate
μ getTimezoneOffset
μ΄ Date
μ getTimezoneOffset
κ³Ό μ½κ° λ€λ₯Έλ°, μ΄ λλ¬Έμ λ¬Έμ κ° μ λλ‘ ν΄κ²°λμ§ μκ³ μμμ΅λλ€. κ·Έλμ μμ€ν
μ νμμ‘΄μ μ ννκ² κΊΌλΌ νμκ° μκΈ° λλ¬Έμ toDate
λ‘ μ νμ ν΄ μ£Όμμ΅λλ€.
@@ -170,6 +174,86 @@ DaylightSavingTimeTransitionSouthern.args = { | |||
}, | |||
}; | |||
|
|||
// NOTE: For manual testing purposes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μμ€ν μ νμμ‘΄μ λͺ¨νΉνλ λμμ΄ μλνλ ν μ€νΈ νκ²½μμλ μ΄λ €μ κΈ° λλ¬Έμ μ§μ ν μ€νΈμ© νμ΄μ§λ₯Ό μμ±νμ¬ νμΈνμ΅λλ€.
@@ -17,6 +19,7 @@ export function useEventsWithTimezone(events: Collection<EventModel>) { | |||
return events; | |||
} | |||
|
|||
const isSystemUsingDST = isUsingDST(new TZDate()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isUsingDST
λ λ λ²μ§Έ μΈμλ‘ νμμ‘΄ μ΄λ¦μ λ£μ§ μμ κ²½μ° νμ¬ μμ€ν
μ κΈ°μ€μΌλ‘ ν΄λΉ μκ°μ DST μ μ© μ¬λΆλ₯Ό κ²°μ ν©λλ€.
μ΄λ₯Ό ν΅ν΄ λΈλΌμ°μ κ° DST μ μ©μ€μΈμ§ μλμ§ νμΈν μλ μκ³ , μ΄λ€ μ΄λ²€νΈκ° μμ€ν νμμ‘΄ κΈ°μ€μΌλ‘λ DST μ μ©μ λ°κ³ μλμ§ μλμ§ νμΈν μ μμ΅λλ€.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
리뷰 μλ£ν©λλ€.
Please check if the PR fulfills these requirements
fix #xxx[,#xxx]
, where "xxx" is the issue number)Description
While rendering events, we need to calculate the offset difference if the system timezone is applicable to DST.
So we need to calculate it under the circumstance below:
Thank you for your contribution to TOAST UI product. π π β¨