@magic-xpa/gui 4.801.0-dev481.340 → 4.801.0-dev481.344
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/src/management/gui/DisplayConvertor.mjs +42 -4
- package/fesm2015/magic-xpa-gui.mjs +41 -3
- package/fesm2015/magic-xpa-gui.mjs.map +1 -1
- package/fesm2020/magic-xpa-gui.mjs +41 -3
- package/fesm2020/magic-xpa-gui.mjs.map +1 -1
- package/package.json +2 -2
- package/src/management/gui/DisplayConvertor.d.ts +1 -1
|
@@ -5371,7 +5371,7 @@ class DisplayConvertor {
|
|
|
5371
5371
|
case StorageAttribute.DATE: {
|
|
5372
5372
|
if (useNative) {
|
|
5373
5373
|
let dt;
|
|
5374
|
-
dt = this.fromMgDateToNativeDate(mgValue, compIdx);
|
|
5374
|
+
dt = this.fromMgDateToNativeDate(mgValue, pic, compIdx);
|
|
5375
5375
|
return dt;
|
|
5376
5376
|
}
|
|
5377
5377
|
else {
|
|
@@ -5619,7 +5619,7 @@ class DisplayConvertor {
|
|
|
5619
5619
|
let time = new NUM_TYPE(dataStr).NUM_2_ULONG();
|
|
5620
5620
|
return this.time_2_a_pic(mask, maskSize, time, pic, time_date_pic_Z_edt, false);
|
|
5621
5621
|
}
|
|
5622
|
-
fromMgDateToNativeDate(dataStr, compIdx) {
|
|
5622
|
+
fromMgDateToNativeDate(dataStr, pic, compIdx) {
|
|
5623
5623
|
let date = new NUM_TYPE(dataStr).NUM_2_ULONG();
|
|
5624
5624
|
let breakParams;
|
|
5625
5625
|
breakParams = new DateBreakParams();
|
|
@@ -5628,7 +5628,45 @@ class DisplayConvertor {
|
|
|
5628
5628
|
breakParams.month = breakParams.month - 1;
|
|
5629
5629
|
if (breakParams.year == 0 && breakParams.month == 0 && breakParams.day == 0)
|
|
5630
5630
|
return null;
|
|
5631
|
-
let
|
|
5631
|
+
let maskStr = pic.getMask();
|
|
5632
|
+
let outVal = NString.ToCharArray(maskStr);
|
|
5633
|
+
let len = pic.getMaskSize();
|
|
5634
|
+
let year = breakParams.year;
|
|
5635
|
+
let outIdx = 0;
|
|
5636
|
+
while (len > 0) {
|
|
5637
|
+
switch (outVal[outIdx].charCodeAt(0)) {
|
|
5638
|
+
case PICInterface.PIC_YY:
|
|
5639
|
+
{
|
|
5640
|
+
this.int_2_a(outVal, outIdx, 2, breakParams.year, '0');
|
|
5641
|
+
let yearStr = NString.FromChars(outVal);
|
|
5642
|
+
year = +yearStr.substr(outIdx);
|
|
5643
|
+
outIdx += 2;
|
|
5644
|
+
len -= 2;
|
|
5645
|
+
}
|
|
5646
|
+
break;
|
|
5647
|
+
case PICInterface.PIC_YY:
|
|
5648
|
+
{
|
|
5649
|
+
this.int_2_a(outVal, outIdx, 2, breakParams.year, '0');
|
|
5650
|
+
let yearStr = NString.FromChars(outVal);
|
|
5651
|
+
year = +yearStr.substr(outIdx);
|
|
5652
|
+
outIdx += 2;
|
|
5653
|
+
len -= 2;
|
|
5654
|
+
}
|
|
5655
|
+
break;
|
|
5656
|
+
case PICInterface.PIC_YYYY:
|
|
5657
|
+
this.int_2_a(outVal, outIdx, 4, year, '0');
|
|
5658
|
+
let yearStr = NString.FromChars(outVal);
|
|
5659
|
+
year = +yearStr.substr(outIdx);
|
|
5660
|
+
outIdx += 4;
|
|
5661
|
+
len -= 4;
|
|
5662
|
+
break;
|
|
5663
|
+
default:
|
|
5664
|
+
outIdx++;
|
|
5665
|
+
len--;
|
|
5666
|
+
break;
|
|
5667
|
+
}
|
|
5668
|
+
}
|
|
5669
|
+
let nativeDt = new Date(year, breakParams.month, breakParams.day);
|
|
5632
5670
|
return nativeDt;
|
|
5633
5671
|
}
|
|
5634
5672
|
fromNativeDateToMgDateNumber(nativeDate, pic) {
|