Skip to content

Commit

Permalink
Fix moment#4390: use offset properly in toISOString
Browse files Browse the repository at this point in the history
  • Loading branch information
ashsearle committed Jan 4, 2018
1 parent a1b527f commit d8a8e87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/moment/format.js
Expand Up @@ -23,7 +23,7 @@ export function toISOString(keepOffset) {
if (utc) {
return this.toDate().toISOString();
} else {
return new Date(this._d.valueOf()).toISOString().replace('Z', formatMoment(m, 'Z'));
return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z'));
}
}
return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ');
Expand Down

0 comments on commit d8a8e87

Please sign in to comment.