Skip to content

Commit

Permalink
v5.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed Jan 7, 2022
1 parent 7e1ddf7 commit 9867ac0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## v5.2.0

### Added

- Add scalars `Date`, `DateTime` and `DateTimeTz`

## v5.1.0

### Added
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@ A collection of custom scalar types for usage with https://github.com/webonyx/gr
You can use the provided Scalars just like any other type in your schema definition.
Check [SchemaUsageTest](tests/SchemaUsageTest.php) for an example.

### [Date](src/Date.php)

A date string with format `Y-m-d`, e.g. `2011-05-23`.

The following conversion applies to all date scalars:
- Outgoing values can either be valid date strings or `\DateTimeInterface` instances.
- Incoming values must always be valid date strings and will be converted to `\DateTimeImmutable` instances.

### [DateTime](src/DateTime.php)

A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`.

### [DateTimeTz](src/DateTimeTz.php)

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`.

### [Email](src/Email.php)

A [RFC 5321](https://tools.ietf.org/html/rfc5321) compliant email.
Expand Down
2 changes: 1 addition & 1 deletion src/DateTimeTz.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class DateTimeTz extends DateScalar
{
public $description /** @lang Markdown */
= 'The `DateTime` scalar type represents time data, represented as an ISO-8601 encoded UTC date string.';
= 'A datetime string with format `Y-m-d\TH:i:s.uP`, e.g. `2020-04-20T16:20:04.000000+04:00`.';

protected static function outputFormat(): string
{
Expand Down

1 comment on commit 9867ac0

@simPod
Copy link
Contributor

@simPod simPod commented on 9867ac0 Jan 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌🏾

Please sign in to comment.