Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing relative date format. #136

Merged
merged 3 commits into from
Dec 12, 2017
Merged

Conversation

grasmash
Copy link
Contributor

No description provided.

@grasmash
Copy link
Contributor Author

grasmash commented Sep 19, 2017

This permits the values for date fields to be entered relative to the current date rather than absolute. This is much more helpful for testing features that have a sense of past and future. For instance, a view that displays future events or a blog that displays only past blog posts.

Example usage:

  Background:
    Given live_lesson content:
      | title                 | field_video                                 | field_air_date      | uid |
      | Mothership Connection | https://www.youtube.com/watch?v=GT3ecv01xDE | relative: now       | 1   |

You can also use values like relative: +1 days, or anything else supported by strtotime(). See http://php.net/manual/en/datetime.formats.relative.j.

@jhedstrom
Copy link
Owner

Seems to be a parsing error:

Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting identifier (T_STRING) or \\ (T_NS_SEPARATOR) in ./src/Drupal/Driver/Fields/Drupal8/DatetimeHandler.php on line 5

The branch could also use a rebase of the latest master.

@grasmash
Copy link
Contributor Author

@jhedstrom Resolved and rebased!

@jhedstrom
Copy link
Owner

Needs a code comment shortened for coding standards check :)

@jhedstrom jhedstrom merged commit 5dec656 into jhedstrom:master Dec 12, 2017
@jhedstrom
Copy link
Owner

Awesome, thanks!

@jhedstrom jhedstrom added this to the 2.0 milestone Dec 12, 2017
@jonathanjfshaw
Copy link
Contributor

#126 now rerolled to allow for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants