-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
F3945: Filter by type my-data page
- Loading branch information
Showing
16 changed files
with
917 additions
and
553 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
import { MyData } from '../../shared/canvas'; | ||
|
||
const MyDataPage = () => { | ||
return ( | ||
<div className="my-data-view view-container" style={{ padding: '0 1em' }}> | ||
<MyData /> | ||
</div> | ||
); | ||
return <MyData />; | ||
}; | ||
|
||
export default MyDataPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.home-mydata { | ||
margin-top: 52px; | ||
.my-data-view { | ||
margin-top: 52px !important; | ||
padding: 0 1em !important; | ||
flex-direction: column !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import * as moment from 'moment'; | ||
import { TDateFilterType } from './types'; | ||
|
||
const makeDatetimePattern = ({ | ||
dateFilterType, | ||
singleDate, | ||
dateStart, | ||
dateEnd, | ||
}: { | ||
dateFilterType?: TDateFilterType; | ||
singleDate?: string; | ||
dateStart?: string; | ||
dateEnd?: string; | ||
}) => { | ||
switch (dateFilterType) { | ||
case 'after': { | ||
if (!!singleDate && moment(singleDate).isValid()) { | ||
return `${singleDate}..*`; | ||
} | ||
return undefined; | ||
} | ||
case 'before': { | ||
if (!!singleDate && moment(singleDate).isValid()) { | ||
return `*..${singleDate}`; | ||
} | ||
return undefined; | ||
} | ||
case 'range': { | ||
if ( | ||
!!dateStart && | ||
!!dateEnd && | ||
moment(dateStart).isValid() && | ||
moment(dateEnd).isValid() && | ||
moment(dateStart).isBefore(moment(dateEnd), 'days') | ||
) { | ||
return `${dateStart}..${dateEnd}`; | ||
} | ||
return undefined; | ||
} | ||
default: | ||
return undefined; | ||
} | ||
}; | ||
|
||
export { makeDatetimePattern }; |
Oops, something went wrong.