How to use the SSF function from xlsx

Find comprehensive JavaScript xlsx.SSF code examples handpicked from public code repositorys.

22
23
24
25
26
27
28
29
30
var cell_ref = XLSX.utils.encode_cell({c:C,r:R});

if(typeof cell.v === 'number') cell.t = 'n';
else if(typeof cell.v === 'boolean') cell.t = 'b';
else if(cell.v instanceof Date) {
  cell.t = 'n'; cell.z = XLSX.SSF._table[14];
  cell.v = datenum(cell.v);
}
else cell.t = 's';
fork icon270
star icon0
watch icon2

127
128
129
130
131
132
133
134
135
136

if (typeof cell.v === 'number') cell.t = 'n';
else if (typeof cell.v === 'boolean') cell.t = 'b';
else if (cell.v instanceof Date) {
  cell.t = 'n';
  cell.z = xlsx.SSF._table[14];
  cell.v = datenum(cell.v);
} else cell.t = 's';

ws[cell_ref] = cell;
fork icon15
star icon23
watch icon3

16
17
18
19
20
21
22
23
24

if (typeof cell.v === 'number') cell.t = 'n';
else if (typeof cell.v === 'boolean') cell.t = 'b';
else if (cell.v instanceof Date) {
  cell.t = 'n';
  cell.z = XLSX.SSF._table[14];
  cell.v = datenum(cell.v);
}
else cell.t = 's';
fork icon17
star icon0
watch icon3

97
98
99
100
101
102
103
104
105
var cell_ref = xlsx.utils.encode_cell({c:C,r:R});

if(typeof cell.v === 'number') cell.t = 'n';
else if(typeof cell.v === 'boolean') cell.t = 'b';
else if(cell.v instanceof Date) {
    cell.t = 'n'; cell.z = xlsx.SSF._table[14];
    cell.v = datenum(cell.v);
}
else cell.t = 's';
fork icon3
star icon6
watch icon13

221
222
223
224
225
226
227
228
229
230
let fechaNacimiento;
const fechaRegex = /(\d{1,2})[-/](\d{1,2})[-/](\d{4})/;

if (!isNaN(item.fecha_nacimiento)) {
  // Si la fecha es un número de serie
  const dateObj = XLSX.SSF.parse_date_code(item.fecha_nacimiento);
  fechaNacimiento = `${dateObj.y}-${dateObj.m
    .toString()
    .padStart(2, "0")}-${dateObj.d.toString().padStart(2, "0")}`;
} else {
fork icon0
star icon0
watch icon0