25D New feature: Default the internal and external posting end date to posting start date plus 30
Summary:
Fx Expression that can be used to set the END-DATE by default on Requisition as START-DATE + 30 .
Code Snippet (add any code snippets that support your topic, if applicable):
/* eslint-disable dot-notation */
define([], () => {
'use strict';
/**
- Default value expression for RequisitionExternalCareerSites.PublishEndDate
- @param {object} context
- @return {string}
*/
function getRequisitionExternalCareerSitesPublishEndDate(context) {
const { $componentContext, $fields, $modules, $user } = context;
const currentDate = new Date();
currentDate.setDate(currentDate.getDate() + 30); // Add 30 days
const year = currentDate.getFullYear();
const month = String(currentDate.getMonth() + 1).padStart(2, '0'); // Months are 0-indexed
const day = String(currentDate.getDate()).padStart(2, '0');
const hours = String(currentDate.getHours()).padStart(2, '0');
const minutes = String(currentDate.getMinutes()).padStart(2, '0');
Tagged:
0