hapijs / hapijs/joi

[Bug] Joi.date().iso() accepts to receive incomplete dates

Open
#2,509 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
21.2k
Forks
1.5k
Avg merge
4h 57m
Merged PRs (30d)
14

Description

#### Support plan

* *is this issue currently blocking your project?* (yes/no): Yes
* *is this issue affecting a production system?* (yes/no): Yes

#### Context
* *module version with issue*: 17.1.1

* Joi autocomplete an invalid format

#### What are you trying to achieve or the steps to reproduce?
* Yes, by https://joi.dev/tester/

#### What was the result you got?
![image](https://user-images.githubusercontent.com/55669043/98400997-bc5c5f00-2043-11eb-82b5-399e0653d8e5.png)
![image](https://user-images.githubusercontent.com/55669043/98401083-ddbd4b00-2043-11eb-98e6-e9582ca83d88.png)

#### What result did you expect?
* Validation Error: "birthDate" must be in ISO 8601 date format

Contributor guide

Open the contributing guide

Research direction

Reproduce the behavior with Joi.date().iso() using the example shown in the issue or the Joi tester, and compare incomplete dates with the expected ISO 8601 validation error. Trace the date validation entry point and add or update coverage so incomplete dates are rejected while valid ISO dates continue to pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.