ManDate

45 views
Skip to first unread message

Piers Warmers

unread,
Apr 10, 2016, 8:04:39 PM4/10/16
to thephpleague
I thought this library might be a nice addition. It's a simple library to test dates for given rule/s:


For example:

use ManDate\Mandate;
use ManDate\Rule\WeekdayRule;
use ManDate\Rule\DaytimeRule;
use ManDate\Rule\MorningRule;

$mandate = new Mandate();

$mandate
    ->andWhere(new WeekdayRule())
    ->andWhere(new DaytimeRule())
    ->andWhereNot(new MorningRule())
;

$date  = new \DateTime('2015-03-02 11:30', new \DateTimeZone('Australia/Sydney'));

if ($mandate->validate($date)) {
    echo 'It\'s a weekday afternoon!';
}

Piers Warmers

unread,
Apr 18, 2016, 11:48:30 PM4/18/16
to thephpleague
Haha... silence :)

Christopher Pitt

unread,
Apr 18, 2016, 11:55:46 PM4/18/16
to thephpleague

Woody Gilk

unread,
Apr 19, 2016, 4:34:15 PM4/19/16
to Piers Warmers, thephpleague
I wonder if this package would be useful as an addition to Period? http://period.thephpleague.com/

--
You received this message because you are subscribed to the Google Groups "thephpleague" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thephpleague...@googlegroups.com.
To post to this group, send email to thephp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/thephpleague/e17f1e13-5eab-40ce-9714-be66ee4c0654%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages