File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
4
4
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
5
5
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
6
6
7
+ ## [ 0.12.30] - 2020-09-09
8
+
9
+ ### Added
10
+ - Support for ` full-date ` and ` full-time ` formats as aliases of ` date ` and ` time ` respectively.
11
+
7
12
## [ 0.12.29] - 2020-03-19
8
13
9
14
### Added
@@ -58,6 +63,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
58
63
### Changed
59
64
- Export ` null ` value instead of skipping it for properties having ` null ` type.
60
65
66
+ [ 0.12.30 ] : https://github.com/swaggest/php-json-schema/compare/v0.12.29...v0.12.30
61
67
[ 0.12.29 ] : https://github.com/swaggest/php-json-schema/compare/v0.12.28...v0.12.29
62
68
[ 0.12.28 ] : https://github.com/swaggest/php-json-schema/compare/v0.12.27...v0.12.28
63
69
[ 0.12.27 ] : https://github.com/swaggest/php-json-schema/compare/v0.12.26...v0.12.27
Original file line number Diff line number Diff line change @@ -10,7 +10,9 @@ class Format
10
10
{
11
11
const DATE_TIME = 'date-time ' ;
12
12
const DATE = 'date ' ;
13
+ const FULL_DATE = 'full-date ' ;
13
14
const TIME = 'time ' ;
15
+ const FULL_TIME = 'full-time ' ;
14
16
const URI = 'uri ' ;
15
17
const IRI = 'iri ' ;
16
18
const EMAIL = 'email ' ;
@@ -40,8 +42,10 @@ public static function validationError($format, $data)
40
42
case self ::DATE_TIME :
41
43
return self ::dateTimeError ($ data );
42
44
case self ::DATE :
45
+ case self ::FULL_DATE :
43
46
return preg_match ('/^ ' . self ::$ dateRegexPart . '$/i ' , $ data ) ? null : 'Invalid date ' ;
44
47
case self ::TIME :
48
+ case self ::FULL_TIME :
45
49
return preg_match ('/^ ' . self ::$ timeRegexPart . '$/i ' , $ data ) ? null : 'Invalid time ' ;
46
50
case self ::URI :
47
51
return Uri::validationError ($ data , Uri::IS_SCHEME_REQUIRED );
You can’t perform that action at this time.
0 commit comments