Tasks: change due text to date instead of time to

master
Andrew P Maney 5 years ago committed by Tom Hacohen
parent 0b5274887f
commit 36d6308c88

@ -11,9 +11,7 @@ import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';
import * as colors from '@material-ui/core/colors'; import * as colors from '@material-ui/core/colors';
import Chip from '@material-ui/core/Chip'; import Chip from '@material-ui/core/Chip';
import moment from 'moment'; import { mapPriority, formatDate } from '../../helpers';
import { mapPriority } from '../../helpers';
const checkboxColor = { const checkboxColor = {
[TaskPriorityType.Undefined]: colors.grey[600], [TaskPriorityType.Undefined]: colors.grey[600],
@ -57,7 +55,7 @@ export default React.memo(function TaskListItem(props: PropsType) {
return ( return (
<ListItem <ListItem
primaryText={title} primaryText={title}
secondaryText={task.dueDate && `Due ${moment().to(task.dueDate.toJSDate())}`} secondaryText={task.dueDate && `Due ${formatDate(task.dueDate)}`}
secondaryTextColor={task.overdue ? 'error' : 'textSecondary'} secondaryTextColor={task.overdue ? 'error' : 'textSecondary'}
onClick={() => onClick(task)} onClick={() => onClick(task)}
leftIcon={ leftIcon={

Loading…
Cancel
Save