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 for timezones with minute Offsets >0 #1599

Merged
merged 1 commit into from Feb 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/formatISO/index.js
Expand Up @@ -93,7 +93,7 @@ export default function formatISO(dirtyDate, dirtyOptions) {

if (offset !== 0) {
const absoluteOffset = Math.abs(offset)
const hourOffset = addLeadingZeros(absoluteOffset / 60, 2)
const hourOffset = addLeadingZeros(Math.floor(absoluteOffset / 60), 2)
const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2)
// If less than 0, the sign is +, because it is ahead of time.
const sign = offset < 0 ? '+' : '-'
Expand Down
2 changes: 1 addition & 1 deletion src/formatISO/test.js
Expand Up @@ -13,7 +13,7 @@ function generateOffset(originalDate) {

if (tzOffset !== 0) {
const absoluteOffset = Math.abs(tzOffset)
const hourOffset = addLeadingZeros(absoluteOffset / 60, 2)
const hourOffset = addLeadingZeros(Math.floor(absoluteOffset / 60), 2)
const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2)
// If less than 0, the sign is +, because it is ahead of time.
const sign = tzOffset < 0 ? '+' : '-'
Expand Down