This is something that I have lived with for several months as there is an easy workaround, but I thought I'd see if anyone knows of a solution, or whether it is a bug.

In Layer Properties > Fields I have set up a date field widget as in the screenshot;

enter image description here

It is set to have a 'Calendar popup'.

It is also set to 'Allow NULL values'. The dataset we are using is based upon polygons that have associated NULL dates. The date is added as and when the polygon has had some sort of involvement by the users.

When in layer edit mode to enter a date, the pop up calendar appears with todays date highlighted. However it is not possible to select todays date.

enter image description here

It is possible to select any other date, and then, after that, it is possible to select today's date.

enter image description here

Is there something that can be done to enable selecting todays date first time, or is this a bug, or shall I just not worry and live with it as it's not a big deal?

[When editing a polygon, without the 'Allow NULL values' field selected, the date is prepopulated with today's date; others dates are selectable. However, as the setting suggests it is not then possible to go back on the entry of a date and enter NULL. The users do need this option, as sometimes when working with 130,000+ polygons they edit the wrong polygon and need to undo their edit.]

2 Answers 2


I can confirm this behavior and I think the issue is only related to the Allow NULL values checkbox.

With the Allow NULL values unchecked you will see that, when you click on the field you want to edit, it automatically displays the today's date and that's right because you can't store a NULL value in the field (obviously, you can change it later).

With the Allow NULL values checked, instead, it should be formally correct that, when you click on the field you want to edit, it still show the NULL value because it is allowed.

For the latter case (i.e. your case) there is a quick solution for avoiding the (very boring) workaround you described: don't ask me why but you will be able to show the today's day by simply pressing the Enter button after having selected the field of interest.

  • 1
    Oh yes! That's so beautiful in its simplicity, and quirkiness. Thanks Commented Mar 26, 2017 at 23:03

Another possibility is to use script in Python Init function and set field value at first to any date except current date and after that to current date if field value is NULL.
In case you need to change it back to NULL value just press small gray button then.

NB! You can check field's NULL value like this:

def formOpen(dialog,layerid,featureid):
    print featureid[2].isNull()

where 2 is the field's position in Layer Properties > Fields window.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.