After using this module on a different project I realized that it was quite valuable, so nice work so far!

I did however need an additional bit of functionality.. I wanted to be able to filter on node created date based on an argument supplied by the user, so I created the following patch to do so.

This patch allows an admin to add one of two different arguments to the view:

  • Node: Created Date Before
  • Node: Created Date After

I'm submitting it here on the off chance that someone else needs something similar. Doug, if you find it core to the module, go ahead and commit it.

Again, thanks for the hard work!

Comments

douggreen’s picture

StatusFileSize
new1.45 KB

Thanks for the contribution. I presume you're trying to get to the URL example.com/yourview/today-1m/today to select from the last month, which is cool. I see the problem which appears to need two arguments. But I'm wondering if you tried to implement this with the 'inside' and 'outside' operators which take two arguments automatically?

I think that the date module also does this, only without the same date mnemonics and math.

Also, I cleaned up the patch a little, and have attached it. I haven't tested it, other than to make sure it displays on the views/edit page.

IncrediblyKenzi’s picture

Hey Doug,

Ostensibly, yes, that's what I was trying to accomplish, but I was unable to get it working with the created date itself (only with CCK date types).

Thanks for cleanin' it up :)

douggreen’s picture

Does this work for you? I'd prefer a single argument that understand ranges, otherwise, it seems to be treading on what the date module does, with the exception that daterange supports the mnuemonics and mnuemonic math.

IncrediblyKenzi’s picture

it works fine for me.

I'm hoping this can co-exist with what the date module does.

And largely I only need one or the other (e.g. "articles created before X date" or "articles created after X date"), but I can conceive of users needing both.

If I need to build a single argument, thath would work as well, I suppose.

douggreen’s picture

Status: Needs review » Fixed

Thanks. Yes, date and daterange can co-exist. But with limited resources, there's no need to duplicate efforts. If date does something well, daterange doesn't need to do it. However, this is a little patch, and I think it offers something (mnuemonic date names) that date.module does not. I committed the patch. I'd still like to see range options which would clearly distinguish this from what the date.module can do.

Anonymous’s picture

Status: Fixed » Closed (fixed)