Commit 73d6a7c0 authored by konovalovsergey's avatar konovalovsergey

fix bug 31395

parent 495bd233
...@@ -341,7 +341,7 @@ var editor; ...@@ -341,7 +341,7 @@ var editor;
if (cultureInfo) { if (cultureInfo) {
var numFormatDigit = AscCommon.oNumFormatCache.get('#,##0.00'); var numFormatDigit = AscCommon.oNumFormatCache.get('#,##0.00');
var formatDate = AscCommonExcel.getShortDateFormat(cultureInfo); var formatDate = AscCommon.getShortDateFormat(cultureInfo);
formatDate += " h:mm"; formatDate += " h:mm";
if (cultureInfo.AMDesignator && cultureInfo.PMDesignator) { if (cultureInfo.AMDesignator && cultureInfo.PMDesignator) {
formatDate += " AM/PM"; formatDate += " AM/PM";
......
...@@ -1202,13 +1202,13 @@ Num.prototype = ...@@ -1202,13 +1202,13 @@ Num.prototype =
} }
switch (this.id) { switch (this.id) {
case 15: case 15:
res = 'd' + separator + 'mmm' + separator + 'yy'; res = AscCommon.getShortDateMonthFormat(true, true, separator, null);
break; break;
case 16: case 16:
res = 'd' + separator + 'mmm'; res = AscCommon.getShortDateMonthFormat(true, false, separator, null);
break; break;
case 17: case 17:
res = 'mmm' + separator + 'yy'; res = AscCommon.getShortDateMonthFormat(false, true, separator, null);
break; break;
} }
} else { } else {
...@@ -1226,7 +1226,7 @@ Num.prototype = ...@@ -1226,7 +1226,7 @@ Num.prototype =
res = AscCommonExcel.getCurrencyFormatSimple(null, true, true, true); res = AscCommonExcel.getCurrencyFormatSimple(null, true, true, true);
break; break;
case 22: case 22:
res = AscCommonExcel.getShortDateFormat(null) + " h:mm"; res = AscCommon.getShortDateFormat(null) + " h:mm";
break; break;
case 14: case 14:
case 27: case 27:
...@@ -1235,7 +1235,7 @@ Num.prototype = ...@@ -1235,7 +1235,7 @@ Num.prototype =
case 30: case 30:
case 31: case 31:
case 36: case 36:
res = AscCommonExcel.getShortDateFormat(null); res = AscCommon.getShortDateFormat(null);
break; break;
case 37: case 37:
res = AscCommonExcel.getCurrencyFormatSimple(null, false, false, false); res = AscCommonExcel.getCurrencyFormatSimple(null, false, false, false);
...@@ -3343,17 +3343,7 @@ CCellValue.prototype = ...@@ -3343,17 +3343,7 @@ CCellValue.prototype =
bTime = true; bTime = true;
var sDateFormat = ""; var sDateFormat = "";
if (bDate) { if (bDate) {
for (var i = 0, length = cultureInfo.ShortDatePattern.length; i < length; i++) { sDateFormat = AscCommon.getShortDateFormat(cultureInfo);
var nIndex = cultureInfo.ShortDatePattern[i] - 0;
if (0 != i)
sDateFormat += "/";
if (0 == nIndex)
sDateFormat += "d";
else if (1 == nIndex)
sDateFormat += "m";
else if (2 == nIndex)
sDateFormat += "yyyy";
}
} }
var sTimeFormat = 'h:mm:ss'; var sTimeFormat = 'h:mm:ss';
if (cultureInfo.AMDesignator.length > 0 && cultureInfo.PMDesignator.length > 0){ if (cultureInfo.AMDesignator.length > 0 && cultureInfo.PMDesignator.length > 0){
...@@ -7559,25 +7549,6 @@ AutoFilterDateElem.prototype.convertDateGroupItemToRange = function(oDateGroupIt ...@@ -7559,25 +7549,6 @@ AutoFilterDateElem.prototype.convertDateGroupItemToRange = function(oDateGroupIt
this.dateTimeGrouping = oDateGroupItem.DateTimeGrouping; this.dateTimeGrouping = oDateGroupItem.DateTimeGrouping;
}; };
function getShortDateFormat(opt_cultureInfo) {
var cultureInfo = opt_cultureInfo ? opt_cultureInfo : AscCommon.g_oDefaultCultureInfo;
var dateElems = [];
for (var i = 0; i < cultureInfo.ShortDatePattern.length; ++i) {
switch (cultureInfo.ShortDatePattern[i]) {
case '0':
dateElems.push('d');
break;
case '1':
dateElems.push('m');
break;
case '2':
dateElems.push('yyyy');
break;
}
}
return dateElems.join('/');
}
function getCurrencyFormatSimple(opt_cultureInfo, opt_fraction, opt_currency, opt_red) { function getCurrencyFormatSimple(opt_cultureInfo, opt_fraction, opt_currency, opt_red) {
var cultureInfo = opt_cultureInfo ? opt_cultureInfo : AscCommon.g_oDefaultCultureInfo; var cultureInfo = opt_cultureInfo ? opt_cultureInfo : AscCommon.g_oDefaultCultureInfo;
var numberFormat = opt_fraction ? '#,##0.00' : '#,##0'; var numberFormat = opt_fraction ? '#,##0.00' : '#,##0';
...@@ -7898,7 +7869,6 @@ function getCurrencyFormat(opt_cultureInfo, opt_fraction, opt_currency, opt_curr ...@@ -7898,7 +7869,6 @@ function getCurrencyFormat(opt_cultureInfo, opt_fraction, opt_currency, opt_curr
window['AscCommonExcel'].DateGroupItem = DateGroupItem; window['AscCommonExcel'].DateGroupItem = DateGroupItem;
window['AscCommonExcel'].SortCondition = SortCondition; window['AscCommonExcel'].SortCondition = SortCondition;
window['AscCommonExcel'].AutoFilterDateElem = AutoFilterDateElem; window['AscCommonExcel'].AutoFilterDateElem = AutoFilterDateElem;
window['AscCommonExcel'].getShortDateFormat = getShortDateFormat;
window['AscCommonExcel'].getCurrencyFormatSimple = getCurrencyFormatSimple; window['AscCommonExcel'].getCurrencyFormatSimple = getCurrencyFormatSimple;
window['AscCommonExcel'].getCurrencyFormat = getCurrencyFormat; window['AscCommonExcel'].getCurrencyFormat = getCurrencyFormat;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment