PHPackages                             lynnlin/date-time-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. lynnlin/date-time-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

lynnlin/date-time-validator
===========================

Validate the date time in laravel controller

1.0.2(9y ago)2121MITPHPPHP &gt;=5.5.9

Since Aug 9Pushed 9y ago1 watchersCompare

[ Source](https://github.com/lynn80827/date-time-validator)[ Packagist](https://packagist.org/packages/lynnlin/date-time-validator)[ RSS](/packages/lynnlin-date-time-validator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (4)Used By (0)

date-time-validator
===================

[](#date-time-validator)

[![Build Status](https://camo.githubusercontent.com/e25a47b8f6793d7a993a930000d7ef9989b19f773f6ed5e78c7d16a870cb7bea/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c796e6e38303832372f646174652d74696d652d76616c696461746f722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/lynn80827/date-time-validator)[![codecov.io](https://camo.githubusercontent.com/67042ed4e86510382b00f3fb69019b9238c1bbaad64a11757d60a5cc6bedb533/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6c796e6e38303832372f646174652d74696d652d76616c696461746f722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/github/lynn80827/date-time-validator?branch=master)[![Packagist](https://camo.githubusercontent.com/890e34e14e22bb563aec93098cc4854b43e63eca783f8105bc96abe1ffcef15e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c796e6e6c696e2f646174652d74696d652d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lynnlin/date-time-validator)[![license](https://camo.githubusercontent.com/7123c32787e013be5a8a13598ad01f562754637ed6141e89b02e85bf16d3e63e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6173686170652f6170697374617475732e7376673f7374796c653d666c61742d737175617265)](http://lynn.mit-license.org/)

Description
-----------

[](#description)

Add a new validation rule `during` to validate whether the given date time is in a specific period which is 6 months by default.

Installation
------------

[](#installation)

Install the package via composer.

```
composer require lynnlin/date-time-validator
```

Add the service provider into `config/app.php`.

```
'providers' => [
	...
	DateTimeValidator\ValidatorServiceProvider::class,
	...
]
```

Usage
-----

[](#usage)

```
use Illuminate\Support\Facades\Validator;

// check 20160123 whether it is in 6 months ago from today
Validator::make(
    ['startAt' => '20160123'],
    ['startAt' => 'during']
);

// check 20150123 whether it is in 1 year ago from today since endAt is not given in the first argument
Validator::make(
    ['startAt' => '20150123'],
    ['startAt' => 'during:endAt,1Y', 'endAt' => 'string']
);

// check 20150123 whether it is in 1 day from 20150124
Validator::make(
    ['startAt' => '20150123', 'endAt' => '20150124'],
    ['startAt' => 'during:endAt,1d', 'endAt' => 'string']
);

// check 20150123 whether it is in 1 week from 20150124
Validator::make(
    ['startAt' => '20150123', 'endAt' => '20150124'],
    ['startAt' => 'during:endAt,1w', 'endAt' => 'string']
);
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

3560d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6379c46d2b49443ce5bdfc4da728f240b0b6d4028d19b85008b3be775e2e6d14?d=identicon)[lynnlin](/maintainers/lynnlin)

---

Top Contributors

[![lynnlin827](https://avatars.githubusercontent.com/u/7734247?v=4)](https://github.com/lynnlin827 "lynnlin827 (10 commits)")

---

Tags

laravellaravelvalidator

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lynnlin-date-time-validator/health.svg)

```
[![Health](https://phpackages.com/badges/lynnlin-date-time-validator/health.svg)](https://phpackages.com/packages/lynnlin-date-time-validator)
```

###  Alternatives

[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

3651.8M3](/packages/sunspikes-clamav-validator)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)[illuminatech/validation-composite

Allows uniting several validation rules into a single one for easy re-usage

184485.5k](/packages/illuminatech-validation-composite)[laravel-validation-rules/phone

Validate that a phone number is in the correct format

69355.5k](/packages/laravel-validation-rules-phone)[stuyam/laravel-phone-validator

A phone validator for Laravel using the free Twilio phone lookup service.

2861.3k](/packages/stuyam-laravel-phone-validator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
