docs: Documentation on how to set default configuration to search for today (#4708)
This commit is contained in:
1 parent
9e047784d1
commit
7734296d1d
2 files changed
+55
No files matched your search
@@ -1,3 +1,20 @@
|
||||
// This is example code that dynamically sets the initial search conditions to
|
||||
// search for today
|
||||
if (window.location.search === '?today') {
|
||||
const now = new Date();
|
||||
const month = now.getMonth() + 1;
|
||||
const day = now.getDate();
|
||||
window.sessionStorage.setItem(
|
||||
'queryFilterValues',
|
||||
JSON.stringify({
|
||||
studyDate: {
|
||||
startDate: `${now.getFullYear()}${month < 10 ? '0' + month : month}${day < 10 ? '0' + day : day}`,
|
||||
endDate: null,
|
||||
},
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/** @type {AppTypes.Config} */
|
||||
window.config = {
|
||||
routerBasename: '/',
|
||||
|
||||
Reference in new issue
Block a user