Skip to content

Commit 9867ac0

Browse files
committed
v5.2.0
1 parent 7e1ddf7 commit 9867ac0

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@ A collection of custom scalar types for usage with https://github.com/webonyx/gr
1818
You can use the provided Scalars just like any other type in your schema definition.
1919
Check [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

2339
A [RFC 5321](https://tools.ietf.org/html/rfc5321) compliant email.

src/DateTimeTz.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class 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
{

0 commit comments

Comments
 (0)