Back Date Validation rule in Transfer page is not working
Summary:
Hi All,
I'm trying to validate the action date is not a past date in Transfer pages using the validation rule in VBCS, but its not working as expected. Any suggestions, below is the code
/* eslint-disable dot-notation */define([], () => { 'use strict';
/** * Hex back date validation * @param {object} context * @return {boolean} */
function isValidActionDate(context) {
const { $fields, $componentContext, $modules, $user } = context;
const actionDate = $fields.employmentWhenAndWhy.ActionDate.$value();
const currentDate = new Date().toISOString().split('T')[0]; if (actionDate < currentDate)}
/** * Hex back date validation * @param {object} context * @return {boolean} */ function runCondition(context) { const { $componentContext, $fields, $modules, $user } = context;
if ($modules.hexBackDateValidation.runCondition) { return true; }
return false; }