Plugin

Archived
Forum
(read-only)

DT Plugin

ExpressionEngine 2, ExpressionEngine 3

Back to this add-on's main page
View Other Add-ons From Jerry Price

     

month=”-1”

Support Request

Verve - Webdesign und Grafik
Verve - Webdesign und Grafik

Hi
In my install month=”-1” says January and not February today.

Am I missing something?

Thanks!

Werner Gusset
# 1
Werner Gusset

Hi

I am using

{exp:dt month="-1" ee_format="true" format="%F %Y"

and this gives today as a result “March 2017”.

This would mean on May 31. a month=”-1” would give me “May” and not “April”, right?

Is there a way to get always a result that is 1 month behind?

On EE 2.11.7 - DT Plugin 1.4.3

jjpmann
# 2
jjpmann

I’ll need to dig into the function but it could be trying to find Feb 29 which was not a valid date this year.

Werner Gusset
# 3
Werner Gusset

Yes March 29. and month=”-1” makes March 1. because February 29. doesn’t exist this year.
It also would make wrong May 31. minus 1 month because April 31. doesn’t exist either.

Thanks for looking at it.

jjpmann
# 4
jjpmann
{exp:dt format="%F %Y" set="first day of -1 month"

Try this

jjpmann
# 5
jjpmann
Verve - Webdesign und Grafik - 29 March 2017 06:10 AM

Hi
In my install month=”-1” says January and not February today.

Am I missing something?

Thanks!

I may need more information to help debug the issue

Verve - Webdesign und Grafik
# 6
Verve - Webdesign und Grafik

Hi
Thanks, this solved my problem.

Great support!

Werner Gusset
# 7
Werner Gusset

Yes, works.

Thank you very much.