Properly display the date value (and not the current date) in the export preview.

SVN:trunk[4116]
This commit is contained in:
Denis Flaven
2016-05-23 13:05:10 +00:00
parent 409ca87f8c
commit 7a6e47f067
2 changed files with 4 additions and 2 deletions

View File

@@ -309,6 +309,7 @@ function PHPDateTimeFormatToMomentFormat(sPHPFormat)
function DateFormatFromPHP(sSQLDate, sPHPFormat)
{
if (sSQLDate === '') return '';
var sPHPDateFormat = PHPDateTimeFormatToSubFormat(sPHPFormat, 'Yydjmn');
var sMomentFormat = PHPDateTimeFormatToMomentFormat(sPHPDateFormat);
return moment(sSQLDate).format(sMomentFormat);
@@ -316,6 +317,7 @@ function DateFormatFromPHP(sSQLDate, sPHPFormat)
function DateTimeFormatFromPHP(sSQLDate, sPHPFormat)
{
if (sSQLDate === '') return '';
var sMomentFormat = PHPDateTimeFormatToMomentFormat(sPHPFormat);
return moment(sSQLDate).format(sMomentFormat);
}

View File

@@ -204,12 +204,12 @@ function FormatDatesInPreview(sRadioSelector, sPreviewSelector)
sPHPFormat = $('#'+sRadioSelector+'_custom_date_time_format').val();
}
$('#interactive_fields_'+sPreviewSelector+' .user-formatted-date-time').each(function() {
var val = $('this').attr('data-date');
var val = $(this).attr('data-date');
var sDisplay = DateTimeFormatFromPHP(val, sPHPFormat);
$(this).html(sDisplay);
});
$('#interactive_fields_'+sPreviewSelector+' .user-formatted-date').each(function() {
var val = $('this').attr('data-date');
var val = $(this).attr('data-date');
var sDisplay = DateFormatFromPHP(val, sPHPFormat);
$(this).html(sDisplay);
});