@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
|
@@ -5378,7 +5378,7 @@ class DisplayConvertor {
|
|
|
5378
5378
|
case StorageAttribute.DATE: {
|
|
5379
5379
|
if (useNative) {
|
|
5380
5380
|
let dt;
|
|
5381
|
-
dt = this.fromMgDateToNativeDate(mgValue, compIdx);
|
|
5381
|
+
dt = this.fromMgDateToNativeDate(mgValue, pic, compIdx);
|
|
5382
5382
|
return dt;
|
|
5383
5383
|
}
|
|
5384
5384
|
else {
|
|
@@ -5626,7 +5626,7 @@ class DisplayConvertor {
|
|
|
5626
5626
|
let time = new NUM_TYPE(dataStr).NUM_2_ULONG();
|
|
5627
5627
|
return this.time_2_a_pic(mask, maskSize, time, pic, time_date_pic_Z_edt, false);
|
|
5628
5628
|
}
|
|
5629
|
-
fromMgDateToNativeDate(dataStr, compIdx) {
|
|
5629
|
+
fromMgDateToNativeDate(dataStr, pic, compIdx) {
|
|
5630
5630
|
let date = new NUM_TYPE(dataStr).NUM_2_ULONG();
|
|
5631
5631
|
let breakParams;
|
|
5632
5632
|
breakParams = new DateBreakParams();
|
|
@@ -5635,7 +5635,45 @@ class DisplayConvertor {
|
|
|
5635
5635
|
breakParams.month = breakParams.month - 1;
|
|
5636
5636
|
if (breakParams.year == 0 && breakParams.month == 0 && breakParams.day == 0)
|
|
5637
5637
|
return null;
|
|
5638
|
-
let
|
|
5638
|
+
let maskStr = pic.getMask();
|
|
5639
|
+
let outVal = NString.ToCharArray(maskStr);
|
|
5640
|
+
let len = pic.getMaskSize();
|
|
5641
|
+
let year = breakParams.year;
|
|
5642
|
+
let outIdx = 0;
|
|
5643
|
+
while (len > 0) {
|
|
5644
|
+
switch (outVal[outIdx].charCodeAt(0)) {
|
|
5645
|
+
case PICInterface.PIC_YY:
|
|
5646
|
+
{
|
|
5647
|
+
this.int_2_a(outVal, outIdx, 2, breakParams.year, '0');
|
|
5648
|
+
let yearStr = NString.FromChars(outVal);
|
|
5649
|
+
year = +yearStr.substr(outIdx);
|
|
5650
|
+
outIdx += 2;
|
|
5651
|
+
len -= 2;
|
|
5652
|
+
}
|
|
5653
|
+
break;
|
|
5654
|
+
case PICInterface.PIC_YY:
|
|
5655
|
+
{
|
|
5656
|
+
this.int_2_a(outVal, outIdx, 2, breakParams.year, '0');
|
|
5657
|
+
let yearStr = NString.FromChars(outVal);
|
|
5658
|
+
year = +yearStr.substr(outIdx);
|
|
5659
|
+
outIdx += 2;
|
|
5660
|
+
len -= 2;
|
|
5661
|
+
}
|
|
5662
|
+
break;
|
|
5663
|
+
case PICInterface.PIC_YYYY:
|
|
5664
|
+
this.int_2_a(outVal, outIdx, 4, year, '0');
|
|
5665
|
+
let yearStr = NString.FromChars(outVal);
|
|
5666
|
+
year = +yearStr.substr(outIdx);
|
|
5667
|
+
outIdx += 4;
|
|
5668
|
+
len -= 4;
|
|
5669
|
+
break;
|
|
5670
|
+
default:
|
|
5671
|
+
outIdx++;
|
|
5672
|
+
len--;
|
|
5673
|
+
break;
|
|
5674
|
+
}
|
|
5675
|
+
}
|
|
5676
|
+
let nativeDt = new Date(year, breakParams.month, breakParams.day);
|
|
5639
5677
|
return nativeDt;
|
|
5640
5678
|
}
|
|
5641
5679
|
fromNativeDateToMgDateNumber(nativeDate, pic) {
|