Jump to content

Get all pages of template created this month?


onjegolders
 Share

Recommended Posts

Hi guys,

Any ideas on how to get all pages of a certain template that have been created this month?

I have tried to test for "created" within the selector and combining it with date("m") but I'm not sure how to go about this?

My goal is to set invoice numbers combing an autoincrementing value with each invoice that is created within a given month.

Any ideas? 

Thanks :)

Link to comment
Share on other sites

  • 5 years later...

2018 update:

You can also use strtotime in selectors since a while (don't know in wich PW version, but it works in versions > 3. So you could do:

$pages->find('template=invoice,created>"first day of this month",created<"last day of this month"'))

 

  • Like 4
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...