Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Job Listing Expiry Date not working in editor #2739

Closed
yscik opened this issue Feb 5, 2024 · 5 comments · Fixed by #2779
Closed

Job Listing Expiry Date not working in editor #2739

yscik opened this issue Feb 5, 2024 · 5 comments · Fixed by #2779
Assignees
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Type] Bug

Comments

@yscik
Copy link
Contributor

yscik commented Feb 5, 2024

From https://wordpress.org/support/topic/job-listing-expiry-date-not-working-in-editor/

When editing an existing Job Listing, the Expiry Date field is not populated with the actual value. Saving the Job Listing will set its expiry date to a month after the current date, regardless of what was previously set.

Looking at the list of job listings, the test listing has the correct expiry date:

image

But if I edit it, the expiry date field is empty:

image

Issue was noticed on a live site but was replicated on a separate WordPress 6.4.3 install using the Twenty Twenty-Four theme with no other plugins.

@joashrajin
Copy link

Additional info from 7677346-zd-a8c

Sometimes i copy jobs via duplicator-Plugin.
When copied the expire-date ist correctly (the same as the original-job), BUT if i edit the copied job and leave the expire-Date-field empty (what it is since the new update) it will change the expire-date automaticly.

Copy link

github-actions bot commented Feb 6, 2024

Support References

This comment is automatically generated. Please do not edit it.

  • 7677346-zen

@github-actions github-actions bot added the Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". label Feb 6, 2024
@btsdev
Copy link

btsdev commented Feb 16, 2024

Hi, I've added a PR for this issue:

#2766

For anyone needing an immediate fix in the meantime, here's the minified and updated code to change in assets/dist/js/datepicker.js

jQuery(document).ready((function(){var date_format_function = function(_date_value) {var date_value = _date_value;var date_tokens = _date_value.split("-");if((date_tokens)&&(date_tokens.length == 3)) {date_tokens[2] = "" + (parseInt(date_tokens[2], 10) + 1);date_value = new Date(date_tokens.join("-")).toLocaleDateString("en-us",{ year: 'numeric', month: 'long', day: 'numeric' });}return date_value;};var e={altFormat:"yy-mm-dd"};"undefined"!=typeof job_manager_datepicker&&(e.dateFormat=job_manager_datepicker.date_format);var t=function(t){var a=jQuery(t),r=jQuery("<input />",{type:"hidden",name:a.attr("name")}).insertAfter(a);if(a.attr("name",a.attr("name")+"-datepicker"),a.on("keyup",(function(){""===a.val()&&r.val("")})),a.datepicker(jQuery.extend({},e,{altField:r})),a.datepicker("option","dateFormat",a.datepicker("option","dateFormat")||"MM d, yy"),a.val(new Date().toLocaleDateString("en-us",{ year: 'numeric', month: 'long', day: 'numeric' }))){var n=a.val().split("-");if(3===n.length){var d=new Date(parseInt(n[0],10),parseInt(n[1],10)-1,parseInt(n[2],10));a.datepicker("setDate",d)}}};jQuery("input.job-manager-datepicker, input#_job_expires").each((function(){t(this)})),jQuery(document).on("wpJobManagerFieldAdded",(function(e){t(e.target)})) jQuery("[name='_job_expires']").val(jQuery("input[name='_job_expires-datepicker']")[0].getAttribute("value"));jQuery("input[name='_job_expires-datepicker']").val(date_format_function(jQuery("input[name='_job_expires-datepicker']")[0].getAttribute("value"))); }));

You'll need to update the version in includes/class-wp-job-manager.php on line 334 to do cache busting so that the above change in datepicker.js shows up.

@Gnodesign
Copy link
Collaborator

Having received multiple tickets regarding this issue, I can confirm that this issue is caused by WPJM. Hopefully, a quick hotfix will be released to iron out this issue, especially since many users are handling job listings through the backend.

@NihongoJobs
Copy link

Greetings! I am not a coder, but I have been asked to share my issue as a job board owner for additional information on this topic.

Once a job ad is posted to my job board, I have a Zap automation in place to add the data to my Airtable, which then triggers posts to social media. I also have backfill job ads coming in from an XML feed, so I need the expiration date to separate the paid/Featured ads from the backfill ads.

Here is how this current issue shows up:

  • Customer pays for job ad and it gets posted to my job board immediately. It shows the expiration date on the front end, but not on the back end.
  • I edit the job ad from the back end by manually adding the expiration date, but I also add an extra day or two to make up for the delay to my customers ("new expiration date").
  • The Zap gets initiated, but the data that gets sent to my Airtable and social media posts shows the old/original expiration date for some reason.

If for any reason I need to edit the job again from the back end, I need to input the expiration date again or else the job ad disappears from my Airtable.

I hope this is helpful, and would be happy to add any more information if requested!
Sincerely,
Kasia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Type] Bug
Projects
None yet
6 participants