Metadata-Version: 2.1
Name: django-datetime-validators
Version: 0.1
Home-page: https://github.com/HasanAshab/django-datetime-validators
Author: Hasan Ashab
Author-email: hasanashab.18205@example.com
License: BSD-3-Clause
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django>=4.0

# Django Date Validators

A set of custom validators for validating date and datetime fields for Django.

## Installation

1. Install the package using pip:

```bash
pip install django-datetime-validators
```

2. Add `datetime_validators` to `INSTALLED_APPS`
```python
INSTALLED_APPS = [
    ...,
    "datetime_validators",
]
```
## Usage

### Date Is Future Validator

Checks if a date is in the future.

```python
from datetime_validators.validators import date_time_is_future_validator

# Using in Models
due_date = models.DateTimeField(
    validators=[date_time_is_future_validator]
)

```

### Other Validators

- **date_is_future_validator**: Checks if a date is in the future.
- **date_is_present_or_future_validator**: Ensures that a date is either in the present or in the future.
- **date_is_past_validator**: Validates that a date is in the past.
- **date_is_present_or_past_validator**: Checks if a date is either in the present or in the past.
- **date_time_is_future_validator**: Validates if a datetime is in the future.
- **date_time_is_present_or_future_validator**: Checks if a datetime is either in the present or in the future.
- **date_time_is_past_validator**: Ensures that a datetime is in the past.
- **date_time_is_present_or_past_validator**: Validates that a datetime is either in the present or in the past.


# Contributing
Contributions are more than wellcome :)
