MCPcopy Index your code
hub / github.com/plotly/dash / getDateState

Function getDateState

components/dash-table/demo/AppMode.ts:289–318  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

287}
288
289function getDateState() {
290 const state = getTypedState();
291
292 (state.tableProps.columns || []).forEach(column => {
293 if (column.id === 'ccc') {
294 column.name = ['Date', 'only'];
295 column.type = ColumnType.Datetime;
296 column.validation = {allow_YY: true};
297 (state.tableProps.data || []).forEach((row, i) => {
298 const d = new Date(Date.UTC(2018, 0, 1));
299 // three day increment
300 d.setUTCDate(3 * i + 1);
301 // date only
302 row.ccc = d.toISOString().substr(0, 10);
303 });
304 } else if (column.id === 'ddd') {
305 column.name = ['Date', 'with', 'time'];
306 column.type = ColumnType.Datetime;
307 (state.tableProps.data || []).forEach((row, i) => {
308 const d = new Date(Date.UTC(2018, 0, 1));
309 // two hours and 11 seconds increment
310 d.setUTCSeconds(i * 7211);
311 // datetime ending with seconds
312 row.ddd = d.toISOString().substr(0, 19).replace('T', ' ');
313 });
314 }
315 });
316
317 return state;
318}
319
320function getVirtualizedState() {
321 const mock = generateMockData(5000);

Callers 1

getModeStateFunction · 0.85

Calls 1

getTypedStateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…