Setting 'date only' field values in XPages. Bug or feature?

I spent a few hours vainly trying to programmatically set a field with a ‘date only’ value via server side javascript in the querySaveDocument event. I tried SSJS equivalents of old LotusScript code such as the following, but in every case the result always created a field with both date and time values.

var dt:NotesDateTime = session.createDateTime("Today");

dt.setAnyTime();

xspDoc.replaceItemValue("DateField", dt);

Finally, I decided to try a more radical approach and get a direct handle on the Notes document object rather than simply working with the XSP document. Presto! - A field with only a date value. Whoopee! The final code looked like this:

var dt:NotesDateTime = session.createDateTime("Today");

dt.setAnyTime();

var notesDoc:NotesDocument = xspDoc.getDocument();

notesDoc.replaceItemValue("DateField",dt);

I wonder though if there is some other method for setting date only field values without having to get a direct handle on the Notes document. Anyone know? Otherwise is this a bug or ‘working as intended’?