In servicenow, i wrote this client script and working, but the date format is now…
- User
In servicenow, i wrote this client script and working, but the date format is now changed. Please modify according to date format. For example my new date format is like 20-Jun-2024. function onLoad() f //Type appropriate comment here, and begin script below. var warrantyDate = g_form.getValue('asset.warranty_expiration'); var warrDate = warrantyDate.split("-"); var fieldDate = new Date(warrDate[0], warrDate[1] - 1, warrDate[2]); var currentDate = new Date(); OSWNFO if (fieldDate < currentDate) ( g_form.removeOption('evaluation_status', 'redeployable'); g_form.removeOption('evaluation_status', 'needs_repair'); ) else g_form.removeOption('evaluation_status', 'non_deployable');
- Assistant
Sure, I'll modify your script to work with the new date format (
DD-MMM-YYYY). Here's the updated version:javascript