Skip to content

Commit

Permalink
Fix the way workpad dates are saved and displayed (elastic#444)
Browse files Browse the repository at this point in the history
* Fix the way workpad dates are saved and displayed

* Don't display the date if there isn't one
  • Loading branch information
lukasolson authored and w33ble committed Apr 10, 2018
1 parent c4460b9 commit 39f6689
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions public/components/workpad_loader/workpad_loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { WorkpadCreate } from './workpad_create';
import { WorkpadSearch } from './workpad_search';
import './workpad_loader.less';

const formatDate = date => moment(date).format('MMM D, YYYY @ h:mma');
const formatDate = date => date && moment(date).format('MMM D, YYYY @ h:mma');

export class WorkpadLoader extends React.PureComponent {
static propTypes = {
Expand Down Expand Up @@ -95,8 +95,8 @@ export class WorkpadLoader extends React.PureComponent {
<thead>
<tr>
<th>Workpad name</th>
<th>Updated</th>
<th>Created</th>
<th>Updated</th>
<th>&nbsp;</th>
</tr>
</thead>
Expand Down
2 changes: 1 addition & 1 deletion server/routes/workpad.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function workpad(server) {
{
...req.payload,
'@timestamp': now,
'@created': workpad['@created'],
'@created': workpad.attributes['@created'],
},
{ overwrite: true, id }
);
Expand Down

0 comments on commit 39f6689

Please sign in to comment.