PHPackages                             wdelfuego/nova4-formattable-date - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. wdelfuego/nova4-formattable-date

Abandoned → [wdelfuego/nova-datetime](/?search=wdelfuego%2Fnova-datetime)Library[Utility &amp; Helpers](/categories/utility)

wdelfuego/nova4-formattable-date
================================

Formattable DateTime fields for Laravel's Nova 4

v1.0.2(4y ago)111.2k↑11.1%MITPHP

Since Apr 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/wdelfuego/nova4-formattable-date)[ Packagist](https://packagist.org/packages/wdelfuego/nova4-formattable-date)[ RSS](/packages/wdelfuego-nova4-formattable-date/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Package deprecated
==================

[](#package-deprecated)

Version 1.0.2 is the final version of this package. If you are using Nova 4.2.4 or newer and want to keep using the `withDateFormat` helper or the custom filters introduced by this package, you should use the generic [wdelfuego/nova-datetime](https://github.com/wdelfuego/nova-datetime) package instead.

As of Nova 4.2.4, custom DateTime formatting is available [natively](https://github.com/laravel/nova-issues/discussions/3929#discussioncomment-2607539) in Nova.

---

This package reintroduces custom DateTime formatting to DateTime fields in Nova 4 resources and comes with a couple of custom filters to circumvent the issues described in [this discussion](https://github.com/laravel/nova-issues/discussions/3929).

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

[](#installation)

Add the dependency to your project's `composer.json`:

```
composer require wdelfuego/nova4-formattable-date
```

Usage
-----

[](#usage)

The examples below assume that the Eloquent model used for the Nova resource has an attribute named 'attribute'.

### Formatting

[](#formatting)

In your Nova resource's `fields` method, add a `DateTime` field as usual but add a call to `withDateFormat` to set the format you want to show on Index and Resource views:

```
    Fields\DateTime::make(__('Localized label'), 'attribute')
        ->withDateFormat('d-M-Y, H:i'),

```

This field will automatically be hidden from Nova's forms, so add another `DateTime` field without `withDateFormat` for the same attribute so your end users can edit the field on forms:

```
    Fields\DateTime::make(__('Localized label'), 'attribute')
        ->onlyOnForms(),

```

The Field with the custom date format can be made `sortable` as usual, but the `filterable` option doesn't work in combination with the custom date format, so if you want to allow end users to filter the Index view based on the formatted `DateTime` column, see the next section for adding the custom filters that come with this package.

### Filtering

[](#filtering)

This package comes with 5 different filters:

- `DateFilter` only shows items whose date match the filter value
- `DateFilterAfter` only shows items whose date is later than the filter value
- `DateFilterAfterOrOn` only shows items whose date is later than or on the same date as the filter value
- `DateFilterBefore` only shows items whose date is earlier than the filter value
- `DateFilterBeforeOrOn` only shows items whose date is earlier than or on the same date as the filter value

You can add a combination of these filters to the Nova resource to allow end users to define a date range.

For example:

```
    public function filters(NovaRequest $request)
    {
        return [
            new DateFilterAfter(__('After'), 'attribute'),
            new DateFilterBefore(__('Before'), 'attribute'),
        ];
    }

```

You can also filter for specific dates only (using a single `DateFilter`) or force open-ended range filtering by adding just one of the other four filters.

Don't forget to add the correct `use` statements for the filters you need to the resource file:

```
use Wdelfuego\Nova4\FormattableDate\Filters\DateFilter;
use Wdelfuego\Nova4\FormattableDate\Filters\DateFilterAfter;
use Wdelfuego\Nova4\FormattableDate\Filters\DateFilterAfterOrOn;
use Wdelfuego\Nova4\FormattableDate\Filters\DateFilterBefore;
use Wdelfuego\Nova4\FormattableDate\Filters\DateFilterBeforeOrOn;

```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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 ~2 days

Total

3

Last Release

1479d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1326136?v=4)[wdelfuego](/maintainers/wdelfuego)[@wdelfuego](https://github.com/wdelfuego)

### Embed Badge

![Health badge](/badges/wdelfuego-nova4-formattable-date/health.svg)

```
[![Health](https://phpackages.com/badges/wdelfuego-nova4-formattable-date/health.svg)](https://phpackages.com/packages/wdelfuego-nova4-formattable-date)
```

###  Alternatives

[optimistdigital/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2872.1M6](/packages/optimistdigital-nova-sortable)[ebess/advanced-nova-media-library

Laravel Nova tools for managing the Spatie media library.

6123.3M21](/packages/ebess-advanced-nova-media-library)[outl1ne/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2861.8M9](/packages/outl1ne-nova-sortable)[eminiarts/nova-tabs

Laravel Nova - Tabs.

4624.1M20](/packages/eminiarts-nova-tabs)[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3403.5M7](/packages/optimistdigital-nova-multiselect-field)[spatie/nova-tags-field

A tags field for Nova apps

3021.9M7](/packages/spatie-nova-tags-field)

PHPackages © 2026

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