Logic based on month | WordPress.org

[ad_1]

Hi

Last year you helped me with a calculation where I needed to apply a 50% discount where the submission date fell between 2 dates. This worked perfectly but I realised the year is hard-coded into the formula e.g.

(function(){
var d = CDATE(fieldname68, ‘yyyy-mm-dd’);
if(d < ‘2022-08-01′ || d > ‘2022-09-30′) return 1;
return 0.5;
})()

Is it possible to make this work when the date falls between August and September so the year does not matter? e.g.

(function(){
var d = CDATE(fieldname68, ‘mm-dd‘);
if(d < ‘08-01‘ || d > ‘09-30‘) return 1;
return 0.5;
})()

I love the plugin and your support is unmatched. 5 star

  • This topic was modified 6 minutes ago by mpbaweb.

The page I need help with: [log in to see the link]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer