mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
Properly display the date value (and not the current date) in the export preview.
SVN:trunk[4116]
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user