Automattic / Automattic/WP-Job-Manager

Date Picker Overwrites Past Expiry Dates When Editing Job Listings

Open
#2,855 3 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
PHP
Stars
899
Forks
369
Avg merge
11h 37m
Merged PRs (30d)
12

Description

**Describe the bug**
When editing a job listing that has a "Listing Expiry Date" set in the past, the date picker automatically resets the input field to the current date instead of retaining the original past expiry date. This behavior makes it difficult for users to review or extend the job listing as they cannot see the previous expiry date and are forced to work with the current date.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to the WP Job Manager admin dashboard.
2. Edit a job listing that has a "Listing Expiry Date" set in the past.
3. Scroll to the "Listing Expiry Date" field.
4. Notice that the date picker automatically changes the field to the current date.

**Screenshots**
![Image](https://github.com/user-attachments/assets/97057c2f-b21b-4b54-9580-55be4024528c)
![Image](https://github.com/user-attachments/assets/538bb417-6ba1-436a-a746-4c443e2d0719)

**Expected behavior**
The date picker should not automatically overwrite a past expiry date with the current date. Instead:

The date picker should retain and display the original expiry date.

While the date picker should restrict users from selecting past dates, the pre-existing past date should remain visible when editing the listing.

**Isolating the problem (mark completed items with an [x]):**
- [x] I have deactivated other plugins and confirmed this bug occurs when only WP Job Manager plugin is active.
- [x] This bug happens with a default WordPress theme active.
- [x] I can reproduce this bug consistently using the steps above.

**WordPress Environment**
- WordPress Version: 6.6.2
- WP Job Manager Version: 2.4.0
- PHP Version: 8.2
- Other important details:

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue from the WordPress admin dashboard by editing a listing with a past Listing Expiry Date, then trace the date-picker initialization for that field. Done means the existing past date remains visible while newly selected past dates remain restricted.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.