Skip to content

Commit

Permalink
fix: force UTC parse (fixes #239)
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Aug 6, 2021
1 parent 4f26d5c commit 1e9a484
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .README/TYPE_PARSERS.md
Expand Up @@ -61,7 +61,7 @@ createTimestampTypeParser();
// {
// name: 'timestamp',
// parse: (value) => {
// return value === null ? value : Date.parse(value);
// return value === null ? value : Date.parse(value + ' UTC');
// }
// }

Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -849,7 +849,7 @@ createTimestampTypeParser();
// {
// name: 'timestamp',
// parse: (value) => {
// return value === null ? value : Date.parse(value);
// return value === null ? value : Date.parse(value + ' UTC');
// }
// }

Expand Down
2 changes: 1 addition & 1 deletion src/factories/typeParsers/createTimestampTypeParser.ts
Expand Up @@ -3,7 +3,7 @@ import type {
} from '../../types';

const timestampParser = (value: string | null) => {
return value === null ? value : Date.parse(value);
return value === null ? value : Date.parse(value + ' UTC');
};

export const createTimestampTypeParser = (): TypeParserType => {
Expand Down
Expand Up @@ -3,7 +3,7 @@ import type {
} from '../../types';

const timestampParser = (value: string | null) => {
return value === null ? value : Date.parse(value);
return value === null ? value : Date.parse(value + ' UTC');
};

export const createTimestampWithTimeZoneTypeParser = (): TypeParserType => {
Expand Down

0 comments on commit 1e9a484

Please sign in to comment.