Admin Columns Manager renders ACF Date Picker fields as 23/08/1970

# Bug report — Classic Monks 2.1.0

**Subject: Admin Columns Manager renders ACF Date Picker fields as 23/08/1970**

## Environment

- Classic Monks 2.1.0

- Advanced Custom Fields PRO 6.8.7

- WordPress 7.0.3, PHP 8.3.20

## Summary

When a column is added for an ACF **Date Picker** field via Admin Columns Manager, every row

displays the same wrong date — `23.08.1970` — regardless of the actual stored value.

Sorting by the same column works correctly; only the rendered output is wrong.

## Steps to reproduce

1. Create a custom post type with an ACF field of type **Date Picker** (e.g. `puppy_birthday`),

display format `d.m.Y`.

2. Add a few posts with different dates, e.g. `07.04.2025` and `24.02.2026`.

3. Enable **Admin Columns Manager** and add that field as a column for the post type.

4. Open the post list.

**Expected:** `07.04.2025` and `24.02.2026`

**Actual:** both rows show `23.08.1970`

## Root cause

ACF’s Date Picker stores its raw meta value in `Ymd` format, e.g. `20250407` — a numeric

**string**, not a Unix timestamp.

`render_acf_field()` deliberately fetches the unformatted value:

```php

$value = get_field( $meta_key, $post_id, false ); // → “20250407”

```

and for `date_picker` (line 322) passes it to `format_date_value()`, where line 668 reads:

```php

// functions/core/content/admin-columns/class-admin-columns-custom-fields.php:668

$timestamp = is_numeric( $value ) ? (int) $value : strtotime( (string) $value );

```

`“20250407”` passes `is_numeric()`, so it is cast to a Unix timestamp:

20,250,407 seconds ≈ 234 days after 1970-01-01 → **1970-08-23**.

This also explains why *every* row shows the same date: any realistic `Ymd` value

(1900-01-01 … 2100-12-31) maps into a ~23-day window in August 1970, and most land on exactly

the same day.

The identical expression also exists at `class-admin-columns-core.php:1362`, which affects plain

custom-field columns configured with the “date/time” format type.

**Not affected:** `date_time_picker` and `time_picker`. ACF stores those as `Y-m-d H:i:s` /

`H:i:s`, which are non-numeric, so the `strtotime()` branch handles them correctly. The bug is

specific to `date_picker`.

**Note:** the field is classified correctly elsewhere — `get_meta_type_for_field()` maps

`date_picker` to `DATE`, and MySQL casts `‘20250407’` properly, which is why sorting gives the

right order. Only rendering is broken.

## Suggested fix

Detect the `Ymd` form before falling back to the numeric-timestamp branch:

```php

private function format_date_value( $value, $format, $with_time ) {

$value     = (string) $value;

$timestamp = false;



// ACF Date Picker stores its raw value as Ymd, e.g. "20250407".

if ( preg_match( '/^**\\d**{8}$/', $value ) ) {

    $date = DateTime::createFromFormat( 'Ymd', $value );

    if ( $date ) {

        $timestamp = $date->setTime( 0, 0 )->getTimestamp();

    }

}



if ( false === $timestamp ) {

    $timestamp = is_numeric( $value ) ? (int) $value : strtotime( $value );

}



if ( ! $timestamp ) {

    return $value;

}



// … existing formatting code unchanged …

}

```

An alternative would be to let ACF format date fields itself

(`get_field( $meta_key, $post_id, true )`), but that returns the field’s own Return Format and

would override the column’s date-format settings, so the explicit `Ymd` check above is probably

preferable.

Hi @IgorPo
Thanks for reporting this bug.

We have addressed this in a previous release, please check v2.2.0 Changelog and update Classic Monks to the latest version.