I was able to fix the problem on my own.
It seems that the function broke when we use some other format instead of default one.
I was able to solve this problem by adding this code in vmjsapi.php file in administrator/component/com_virtuemart/helpers directory.
The code below starts at line # 816 for me
if ($date) {
$formatedDate = JHtml::_('date', $date, $dateFormat );
// date patch for the one day behind issue.
$date1 = new DateTime($date);
$formatedDate = $date1->format("$dateFormat");
}
else {
$formatedDate = vmText::_('COM_VIRTUEMART_NEVER');
}