@fileverse-dev/fortune-core 1.3.4-date-format-2 → 1.3.4-right
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/es/modules/cell.js +8 -6
- package/es/modules/format.js +4 -2
- package/lib/modules/cell.js +8 -6
- package/lib/modules/format.js +4 -2
- package/package.json +1 -1
package/es/modules/cell.js
CHANGED
|
@@ -135,6 +135,9 @@ export function setCellValue(ctx, r, c, d, v) {
|
|
|
135
135
|
if (!_.isNil(v.ct)) {
|
|
136
136
|
cell.ct = v.ct;
|
|
137
137
|
}
|
|
138
|
+
if (!_.isNil(v.ht)) {
|
|
139
|
+
cell.ht = v.ht;
|
|
140
|
+
}
|
|
138
141
|
}
|
|
139
142
|
if (_.isPlainObject(v.v)) {
|
|
140
143
|
vupdate = v.v.v;
|
|
@@ -286,15 +289,16 @@ export function setCellValue(ctx, r, c, d, v) {
|
|
|
286
289
|
t: "n"
|
|
287
290
|
});
|
|
288
291
|
}
|
|
289
|
-
|
|
290
|
-
cell.ht = 2;
|
|
291
|
-
}
|
|
292
|
+
cell.ht = 2;
|
|
292
293
|
}
|
|
293
294
|
var mask = update(fa, vupdate);
|
|
294
295
|
if (mask === vupdate) {
|
|
295
296
|
mask = genarate(vupdate);
|
|
296
297
|
cell.m = mask[0].toString();
|
|
297
298
|
cell.ct = mask[1], cell.v = mask[2];
|
|
299
|
+
if (isRealNum(vupdate)) {
|
|
300
|
+
cell.ht = 2;
|
|
301
|
+
}
|
|
298
302
|
} else {
|
|
299
303
|
if (v.m) {
|
|
300
304
|
cell.m = v.m;
|
|
@@ -317,9 +321,7 @@ export function setCellValue(ctx, r, c, d, v) {
|
|
|
317
321
|
var strValue = String(vupdate);
|
|
318
322
|
var format = getNumberFormat(strValue, commaPresent);
|
|
319
323
|
cell.m = v.m ? v.m : update(format, cell.v);
|
|
320
|
-
|
|
321
|
-
cell.ht = 2;
|
|
322
|
-
}
|
|
324
|
+
cell.ht = 2;
|
|
323
325
|
cell.ct = {
|
|
324
326
|
fa: format,
|
|
325
327
|
t: "n"
|
package/es/modules/format.js
CHANGED
|
@@ -242,7 +242,9 @@ export function genarate(value) {
|
|
|
242
242
|
var map = {
|
|
243
243
|
"yyyy-MM-dd": "dd/MM/yyyy",
|
|
244
244
|
"yyyy-MM-dd HH:mm": "dd/MM/yyyy",
|
|
245
|
+
"yyyy-MM-dd HH:mm:ss": "dd/MM/yyyy",
|
|
245
246
|
"yyyy-MM-ddTHH:mm": "dd/MM/yyyy",
|
|
247
|
+
"yyyy-MM-ddTHH:mm:ss": "dd/MM/yyyy",
|
|
246
248
|
"yyyy/MM/dd": "dd/MM/yyyy",
|
|
247
249
|
"yyyy/MM/dd HH:mm": "dd/MM/yyyy",
|
|
248
250
|
"yyyy.MM.dd": "yyyy.MM.dd",
|
|
@@ -258,12 +260,12 @@ export function genarate(value) {
|
|
|
258
260
|
ct.fa = map[df.formatType] || "dd/MM/yyyy";
|
|
259
261
|
m = SSF.format(ct.fa, v);
|
|
260
262
|
} else {
|
|
261
|
-
m = value
|
|
263
|
+
m = String(value);
|
|
262
264
|
ct.fa = "General";
|
|
263
265
|
ct.t = "g";
|
|
264
266
|
}
|
|
265
267
|
} else {
|
|
266
|
-
m = value
|
|
268
|
+
m = String(value);
|
|
267
269
|
ct.fa = "General";
|
|
268
270
|
ct.t = "g";
|
|
269
271
|
}
|
package/lib/modules/cell.js
CHANGED
|
@@ -168,6 +168,9 @@ function setCellValue(ctx, r, c, d, v) {
|
|
|
168
168
|
if (!_lodash.default.isNil(v.ct)) {
|
|
169
169
|
cell.ct = v.ct;
|
|
170
170
|
}
|
|
171
|
+
if (!_lodash.default.isNil(v.ht)) {
|
|
172
|
+
cell.ht = v.ht;
|
|
173
|
+
}
|
|
171
174
|
}
|
|
172
175
|
if (_lodash.default.isPlainObject(v.v)) {
|
|
173
176
|
vupdate = v.v.v;
|
|
@@ -319,15 +322,16 @@ function setCellValue(ctx, r, c, d, v) {
|
|
|
319
322
|
t: "n"
|
|
320
323
|
});
|
|
321
324
|
}
|
|
322
|
-
|
|
323
|
-
cell.ht = 2;
|
|
324
|
-
}
|
|
325
|
+
cell.ht = 2;
|
|
325
326
|
}
|
|
326
327
|
var mask = (0, _format.update)(fa, vupdate);
|
|
327
328
|
if (mask === vupdate) {
|
|
328
329
|
mask = (0, _format.genarate)(vupdate);
|
|
329
330
|
cell.m = mask[0].toString();
|
|
330
331
|
cell.ct = mask[1], cell.v = mask[2];
|
|
332
|
+
if ((0, _validation.isRealNum)(vupdate)) {
|
|
333
|
+
cell.ht = 2;
|
|
334
|
+
}
|
|
331
335
|
} else {
|
|
332
336
|
if (v.m) {
|
|
333
337
|
cell.m = v.m;
|
|
@@ -350,9 +354,7 @@ function setCellValue(ctx, r, c, d, v) {
|
|
|
350
354
|
var strValue = String(vupdate);
|
|
351
355
|
var format = (0, _utils.getNumberFormat)(strValue, commaPresent);
|
|
352
356
|
cell.m = v.m ? v.m : (0, _format.update)(format, cell.v);
|
|
353
|
-
|
|
354
|
-
cell.ht = 2;
|
|
355
|
-
}
|
|
357
|
+
cell.ht = 2;
|
|
356
358
|
cell.ct = {
|
|
357
359
|
fa: format,
|
|
358
360
|
t: "n"
|
package/lib/modules/format.js
CHANGED
|
@@ -253,7 +253,9 @@ function genarate(value) {
|
|
|
253
253
|
var map = {
|
|
254
254
|
"yyyy-MM-dd": "dd/MM/yyyy",
|
|
255
255
|
"yyyy-MM-dd HH:mm": "dd/MM/yyyy",
|
|
256
|
+
"yyyy-MM-dd HH:mm:ss": "dd/MM/yyyy",
|
|
256
257
|
"yyyy-MM-ddTHH:mm": "dd/MM/yyyy",
|
|
258
|
+
"yyyy-MM-ddTHH:mm:ss": "dd/MM/yyyy",
|
|
257
259
|
"yyyy/MM/dd": "dd/MM/yyyy",
|
|
258
260
|
"yyyy/MM/dd HH:mm": "dd/MM/yyyy",
|
|
259
261
|
"yyyy.MM.dd": "yyyy.MM.dd",
|
|
@@ -269,12 +271,12 @@ function genarate(value) {
|
|
|
269
271
|
ct.fa = map[df.formatType] || "dd/MM/yyyy";
|
|
270
272
|
m = _ssf.default.format(ct.fa, v);
|
|
271
273
|
} else {
|
|
272
|
-
m = value
|
|
274
|
+
m = String(value);
|
|
273
275
|
ct.fa = "General";
|
|
274
276
|
ct.t = "g";
|
|
275
277
|
}
|
|
276
278
|
} else {
|
|
277
|
-
m = value
|
|
279
|
+
m = String(value);
|
|
278
280
|
ct.fa = "General";
|
|
279
281
|
ct.t = "g";
|
|
280
282
|
}
|