Skip to content

Commit

Permalink
fix(postgres): fix parsing of timestamptz values with negative time…
Browse files Browse the repository at this point in the history
…zone
  • Loading branch information
B4nan committed Sep 3, 2024
1 parent ed0560b commit 8ccc925
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/utils/EntityComparator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ export class EntityComparator {
lines.push(`${padding} } else {`);
lines.push(`${padding} ${key} = parseDate(${value});`);
} else {
lines.push(`${padding} } else if (typeof ${value} === 'number' || ${value}.includes('+') || ${value}.endsWith('Z')) {`);
lines.push(`${padding} } else if (typeof ${value} === 'number' || ${value}.includes('+') || ${value}.lastIndexOf('-') > 10 || ${value}.endsWith('Z')) {`);
lines.push(`${padding} ${key} = parseDate(${value});`);
lines.push(`${padding} } else {`);
lines.push(`${padding} ${key} = parseDate(${value} + '${tz}');`);
Expand Down

0 comments on commit 8ccc925

Please sign in to comment.