It is impossible to define a date field which is not required and has a blank default value.
You always get a rendered date value and can't leave the field empty/define an empty_option.

Comments

seppelM’s picture

Issue summary: View changes
dcam’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: -forms, -Field API, -date +Needs steps to reproduce

We'll need you to clarify something. Are you talking about the field provided by the Date contrib module or the Form API '#type' = 'date' element? Giving us some steps to reproduce the problem would help.

garbo’s picture

Hi DCAM,

The Form API '#type' = 'date' element doesn't give the opportunity to have an #empty_option. This can sometimes be very unhandy.

greggles’s picture

Title: Field type date: empty value/empty option » Form field #type date: empty value/empty option
Version: 7.35 » 7.x-dev
Category: Bug report » Feature request
Status: Postponed (maintainer needs more info) » Active
Issue tags: -Needs steps to reproduce

Updating some values. I was surprised this isn't easily possible.

There are some workarounds for this:
* forum post
* stack exchange answer

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.