Skip to content

Commit

Permalink
fix: passing options when using @IsDateString()
Browse files Browse the repository at this point in the history
`@IsDateString({strict: true})` doesn't work because options are not passed to the validator.

Fixes typestack#1061
  • Loading branch information
hakimio authored May 26, 2021
1 parent 6ebcca6 commit 9f6692f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/decorator/string/IsDateString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function IsDateString(
name: IS_DATE_STRING,
constraints: [options],
validator: {
validate: (value, args): boolean => isDateString(value),
validate: (value, args): boolean => isDateString(value, args.constraints[0]),
defaultMessage: buildMessage(
eachPrefix => eachPrefix + '$property must be a valid ISO 8601 date string',
validationOptions
Expand Down

0 comments on commit 9f6692f

Please sign in to comment.