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

Need available to get the passed date without of time #3

Open
peter-gribanov opened this issue Jun 9, 2017 · 0 comments
Open

Need available to get the passed date without of time #3

peter-gribanov opened this issue Jun 9, 2017 · 0 comments

Comments

@peter-gribanov
Copy link
Member

// current date is '2016-12-07 15:27:44'

// return 'Today'
$formatter->passed(new \DateTime('2016-12-07 15:12:24'), false);
// return 'Today'
$formatter->passed(new \DateTime('2016-12-07 15:30:44'), false);
// return 'Today'
$formatter->passed(new \DateTime('2016-12-07 10:24:44'), false);
// return 'Yesterday'
$formatter->passed(new \DateTime('2016-12-06 15:27:44'), false);
// return 'Tomorrow'
$formatter->passed(new \DateTime('2016-12-08 15:27:44'), false);
// return '24 January'
$formatter->passed(new \DateTime('2016-12-24 15:27:44'), false);
// return '24 April 2016'
$formatter->passed(new \DateTime('2016-04-07 15:27:44'), false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant