File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## Unreleased
99
10+ ## v5.2.0
11+
12+ ### Added
13+
14+ - Add scalars ` Date ` , ` DateTime ` and ` DateTimeTz `
15+
1016## v5.1.0
1117
1218### Added
Original file line number Diff line number Diff line change @@ -18,6 +18,22 @@ A collection of custom scalar types for usage with https://github.com/webonyx/gr
1818You can use the provided Scalars just like any other type in your schema definition.
1919Check [ SchemaUsageTest] ( tests/SchemaUsageTest.php ) for an example.
2020
21+ ### [ Date] ( src/Date.php )
22+
23+ A date string with format ` Y-m-d ` , e.g. ` 2011-05-23 ` .
24+
25+ The following conversion applies to all date scalars:
26+ - Outgoing values can either be valid date strings or ` \DateTimeInterface ` instances.
27+ - Incoming values must always be valid date strings and will be converted to ` \DateTimeImmutable ` instances.
28+
29+ ### [ DateTime] ( src/DateTime.php )
30+
31+ A datetime string with format ` Y-m-d H:i:s ` , e.g. ` 2018-05-23 13:43:32 ` .
32+
33+ ### [ DateTimeTz] ( src/DateTimeTz.php )
34+
35+ A datetime string with format ` Y-m-d\TH:i:s.uP ` , e.g. ` 2020-04-20T16:20:04+04:00 ` , ` 2020-04-20T16:20:04Z ` .
36+
2137### [ Email] ( src/Email.php )
2238
2339A [ RFC 5321] ( https://tools.ietf.org/html/rfc5321 ) compliant email.
Original file line number Diff line number Diff line change 55class DateTimeTz extends DateScalar
66{
77 public $ description /** @lang Markdown */
8- = 'The `DateTime` scalar type represents time data, represented as an ISO-8601 encoded UTC date string . ' ;
8+ = 'A datetime string with format `Y-m-d\TH:i:s.uP`, e.g. `2020-04-20T16:20:04.000000+04:00` . ' ;
99
1010 protected static function outputFormat (): string
1111 {
You can’t perform that action at this time.
0 commit comments