Date criteria problem | WordPress.org

[ad_1]

Hi;

fieldname13 = User selected date

fieldname22 = Estimated Date of Birth

it states. I wrote a criterion, if 2 criteria date is greater and less, it adds an expression to the result.

Currently the benchmark is working, but there is a problem. For example, I selected a date before March 5, 2023, it prints the correct result. However, when we select March 8, 2023 without refreshing the page, it takes the post-criterion criterion into account. Is it possible to put a reset in between?
Thanks.

Sample : I chose March 05, 2023. criteria5 += ‘he gave birth first’; writes a warning.
Without refreshing the page;

I chose 08 March 2023. criteria5 += ‘he gave birth first’; should write a warning
criteria5 += ‘she will give birth later.’; writes a warning.

(function(){

  var o = DATEDIFF(fieldname22, fieldname19, 'dd-mm-yyyy', 'd');
  var kriter5 = o['days'] + ' gün';

  if (fieldname13 < fieldname19) {
    kriter5 += ' önce doğum yaptı.';
  } else if (fieldname13 > fieldname19) {
    kriter5 += ' sonra doğum yapacak.';
  }

  jQuery('#calculation-kriter5').html(kriter5);
  jQuery('.kriter5-aciklama').html('Doğuma Kalan Süre : ');
  jQuery('.kriter5-sonuc').html(kriter5);

  return kriter5;
})();
  • This topic was modified 1 hour, 26 minutes ago by klingbeil.

 

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