neat-php / http-server

Neat HTTP Server components
MIT License
0 stars 0 forks source link

Input date/time methods #2

Open annavanbiemen opened 4 years ago

annavanbiemen commented 4 years ago

It would be nice to have some way of receiving input as DateTime objects:

public function dateTime(string $var, $filter = null): ?DateTime

public function date(string $var, $filters = null): ?DateTime // 00:00:00
public function dateEnd(string $var, $filter = null): ?DateTime // 23:59:59

public function week(string $var, $filters = null): ?DateTime // monday 00:00:00
public function weekEnd(string $var, $filters = null): ?DateTime // sunday 23:59:59

public function month(string $var, $filters = null): ?DateTime // first day of month 00:00:00
public function monthEnd(string $var, $filters = null): ?DateTime // last day of month 23:59:59

public function year(string $var, $filters = null): ?DateTime // first day of year 00:00:00
public function yearEnd(string $var, $filters = null): ?DateTime // last day of year 23:59:59