-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from delta-reporter/resolution
Resolution v1.1
- Loading branch information
Showing
7 changed files
with
168 additions
and
199 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
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
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,25 +1,39 @@ | ||
import React from "react" | ||
import {Typography, Tooltip} from "@material-ui/core" | ||
|
||
export function showDateText(date) { | ||
export function showDateText(date, darkMode) { | ||
let dateBadge | ||
let dateString = new Date(date).toUTCString(); | ||
let day = dateString.split(' ').slice(0, 3).join(' '); | ||
let hour = dateString.split(' ').slice(-2)[0]; | ||
dateString= day + ", " + hour | ||
|
||
dateBadge = ( | ||
<Tooltip title="End date"> | ||
<button style={ | ||
{ | ||
color: "#6B8E23", | ||
margin: "5px", | ||
backgroundColor: "white", | ||
border: "none", | ||
} | ||
}> | ||
{dateString} </button> | ||
</Tooltip> | ||
) | ||
if(darkMode) { | ||
dateBadge = ( | ||
<Tooltip title="End date"> | ||
<button style={ | ||
{ | ||
color: "#6B8E23", | ||
margin: "5px", | ||
backgroundColor: "#2a2a2a", | ||
border: "1px solid", | ||
} | ||
}> | ||
{dateString} </button> | ||
</Tooltip> | ||
) | ||
} else | ||
dateBadge = ( | ||
<Tooltip title="End date"> | ||
<button style={ | ||
{ | ||
color: "#6B8E23", | ||
margin: "5px", | ||
backgroundColor: "white", | ||
border: "none", | ||
} | ||
}> | ||
{dateString} </button> | ||
</Tooltip> | ||
) | ||
return dateBadge | ||
} |
Oops, something went wrong.