Question

10
Replies
1962
Views
Stalin Arockiam (STALIN A)
Monarch Info Tech Services Ltd
Technical Architect
Monarch Info Tech Services Ltd
IN
STALIN A Member since 2011 3 posts
Monarch Info Tech Services Ltd
Posted: June 9, 2016
Last activity: June 27, 2016
Posted: 9 Jun 2016 1:42 EDT
Last activity: 27 Jun 2016 21:42 EDT
Closed

Date Time field defaults to current time after upgrade

Issue with the Date-Time Calendar after upgrading from PRPC 6.1 to Pega 7.1.7. In the earlier version, the time is defaulted to 12:00 AM but in Pega 7.1.7 it defaults to current time.


I verified the related Support Article SA-12489.


PegaSystems suggested the following change to make the time defaulted to "00:00"


1. Create a non-auto generated section with below code.

Show More

Issue with the Date-Time Calendar after upgrading from PRPC 6.1 to Pega 7.1.7. In the earlier version, the time is defaulted to 12:00 AM but in Pega 7.1.7 it defaults to current time.


I verified the related Support Article SA-12489.


PegaSystems suggested the following change to make the time defaulted to "00:00"


1. Create a non-auto generated section with below code.

<script>
try {
var dateTimeControlsIDs = [""];
debugger;
for (var idx = 0; idx < dateTimeControlsIDs.length; idx++) {
var iconSpanObj = document.getElementById(dateTimeControlsIDs[idx]);
if (iconSpanObj) {
pega.util.Event.removeListener(iconSpanObj, 'click', setDefaultHoursAndMinutes);
pega.util.Event.addListener(iconSpanObj, 'click', setDefaultHoursAndMinutes);
}
}
} catch(e) { }
function setDefaultHoursAndMinutes(event) {
var _element = pega.util.Event.getTarget(event);
setTimeout(function() {
if (_element && _element.parentNode) {
var inputElem = pega.util.Dom.getFirstChild(_element.parentNode);
if (inputElem && inputElem.value != "") {
return;
}
}
var hoursDropObj = document.getElementById("hourDrop");
if(hoursDropObj) {
var listLength = hoursDropObj.options.length;
for (var i = 0; i < listLength; i++) {
if (hoursDropObj.options[i].value == 0) {
hoursDropObj.options[i].selected = true;
hoursDropObj.options[i].defaultSelected = true;
}
}
var minuteDropObj = document.getElementById("minuteDrop");
listLength = minuteDropObj.options.length;
for (var i = 0; i < listLength; i++) {
if (minuteDropObj.options[i].value == 0) {
minuteDropObj.options[i].selected = true;
minuteDropObj.options[i].defaultSelected = true;
}
}
}
}, 100);
}
</script>

2. Include this section, into the master section.

but this approach is not working. still the date time is set to current date time. Is there anything else we need to do to set the time to "12:00 AM"  or 00:00?


Message was edited by: Joe Stalin

Thanks for your response, I will check and reply you soon.

Joe Stalin

Show Less
System Administration Upgrades User Experience Reporting
Moderation Team has archived post, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.