You are using views_handler_field_date and in some Componentns like stormtask und stormproject you addd the hook_date_api_fields().

In ticket, timetracking, invoice and expenses this hook is missing.

I will add a patch which add that hook.

CommentFileSizeAuthor
#1 date_api_view-1153672-1.patch4.65 KBkfritsche

Comments

kfritsche’s picture

Status: Active » Needs review
StatusFileSize
new4.65 KB

And here the patch.

juliangb’s picture

Has this been tested on an existing installation?

We previously tried something like this and had issues with blank dates defaulting to 1900-01-01.

(Haven't tried this one yet - you may have fixed that).

kfritsche’s picture

Only tested this with the trackingdate for timetrackings. This worked. (Calendar implementation in Storm Contrib for Timetrackings)

I will test this later today, more carefully...
Where and how do you get this blank dates?

kfritsche’s picture

It seems to be working for now.
I uploaded my test view - #889610: List pages to be default views Comment 11.
Hopes this helps.

juliangb’s picture

I've had a more detailed read through. Sorry, I misunderstood what this was doing - this shouldn't cause any blank dates - that was due to date api and date popup on the node edit form.

One comment from the read through:

+++ b/stormexpense/stormexpense.views.inc
@@ -248,3 +248,37 @@ function stormexpense_views_handlers() {
+/**
+ * Implementation of hook_date_api_fields().
+ * on behalf of core fields.
+ *
+ * All modules that create custom fields that use the
+ * 'views_handler_field_date' handler can provide
+ * additional information here about the type of
+ * date they create so the date can be used by
+ * the Date API views date argument and date filter.
+ */

A copy and paste? This bit probably isn't relevant to Storm.

Powered by Dreditor.

juliangb’s picture

Status: Needs review » Needs work

I think this simply needs the edits to the comments and it can go in.

juliangb’s picture

I've been testing this with the views that you posted.

Just to make it easier for me - what should I be looking for as a change when this patch is applied?

kfritsche’s picture

Oh sorry for my late answer, i was busy last week...

The difference is mostly see when sorting this field. You can set the granularity and the correct sql sort is done.

Also this is needed for the calendar module, so you can set this fields as date argument there. This is needed to show this items in the calendar.

The test view is mostly there, to check if nothing else is broken, because of your comment in #2...

kfritsche’s picture

Status: Needs work » Fixed

commited without these copy&past comments to 2.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.