MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / Vt

Function Vt

codebase/dhtmlxscheduler.es.js:1268–1560  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

1266 return i;
1267}
1268function Vt(e) {
1269 var i = function(a, o) {
1270 for (var _ = "var temp=date.match(/[a-zA-Z]+|[0-9]+/g);", r = a.match(/%[a-zA-Z]/g), d = 0; d < r.length; d++)
1271 switch (r[d]) {
1272 case "%j":
1273 case "%d":
1274 _ += "set[2]=temp[" + d + "]||1;";
1275 break;
1276 case "%n":
1277 case "%m":
1278 _ += "set[1]=(temp[" + d + "]||1)-1;";
1279 break;
1280 case "%y":
1281 _ += "set[0]=temp[" + d + "]*1+(temp[" + d + "]>50?1900:2000);";
1282 break;
1283 case "%g":
1284 case "%G":
1285 case "%h":
1286 case "%H":
1287 _ += "set[3]=temp[" + d + "]||0;";
1288 break;
1289 case "%i":
1290 _ += "set[4]=temp[" + d + "]||0;";
1291 break;
1292 case "%Y":
1293 _ += "set[0]=temp[" + d + "]||0;";
1294 break;
1295 case "%a":
1296 case "%A":
1297 _ += "set[3]=set[3]%12+((temp[" + d + "]||'').toLowerCase()=='am'?0:12);";
1298 break;
1299 case "%s":
1300 _ += "set[5]=temp[" + d + "]||0;";
1301 break;
1302 case "%M":
1303 _ += "set[1]=this.locale.date.month_short_hash[temp[" + d + "]]||0;";
1304 break;
1305 case "%F":
1306 _ += "set[1]=this.locale.date.month_full_hash[temp[" + d + "]]||0;";
1307 }
1308 var l = "set[0],set[1],set[2],set[3],set[4],set[5]";
1309 return o && (l = " Date.UTC(" + l + ")"), new Function("date", "var set=[0,0,1,0,0,0]; " + _ + " return new Date(" + l + ");");
1310 }, t = function(a, o) {
1311 const _ = a.match(/%[a-zA-Z]/g);
1312 return function(r) {
1313 for (var d = [0, 0, 1, 0, 0, 0], l = r.match(/[a-zA-Z]+|[0-9]+/g), h = 0; h < _.length; h++)
1314 switch (_[h]) {
1315 case "%j":
1316 case "%d":
1317 d[2] = l[h] || 1;
1318 break;
1319 case "%n":
1320 case "%m":
1321 d[1] = (l[h] || 1) - 1;
1322 break;
1323 case "%y":
1324 d[0] = 1 * l[h] + (l[h] > 50 ? 1900 : 2e3);
1325 break;

Callers 1

eaFunction · 0.70

Calls 13

sFunction · 0.70
rFunction · 0.70
gFunction · 0.70
cFunction · 0.70
uFunction · 0.70
date_partMethod · 0.65
addMethod · 0.65
month_startMethod · 0.65
to_fixedMethod · 0.65
getUTCISOWeekMethod · 0.65
getISOWeekMethod · 0.65
bindMethod · 0.65

Tested by

no test coverage detected