Skip to content

Request: Add relative validation support and keywords for date,date-time  #41

@tars400

Description

@tars400

We need to support relative validation on json-schema for date format.

Is there any existing support where relative validations are supported for 'date' or 'date-time' formats ?, as the current schema supports only absolute validation with formatMinimum and formatMaximum.

Something like below:

{
	type: 'string',
	format: 'date',
	formatMinimum: '2019-08-16',	
	formatMaximum: '2022-08-16',	
	relativeMinimumDate: -50,	// -ve for current day - number of days
	relativeMaximumDate: 20,       //  +ve for current day + number of days 
	//  considering the above example, input date should be between last 50 days to coming 20 days.
}

relative minimum and relative maximum format would validate on date relatively example: last 1 year, last 20 days, last 12 months etc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions