Skip to content

Commit

Permalink
if date is missing, don't fallback to current date
Browse files Browse the repository at this point in the history
  • Loading branch information
zotya committed Feb 9, 2023
1 parent 1bc2c7d commit fbf3d5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions searchlib/components/DateTime/DateTime.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { DateTime } from 'luxon';
const FormatDateTime = (props) => {
const { value, format = 'DATE_SHORT' } = props;

if (value === null){
return null;
}
const dt = value
? value.isLuxonDateTime
? value
Expand Down
2 changes: 1 addition & 1 deletion searchlib/lib/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export class ResultModel extends BasicModel {

get issued() {
const raw = this._result['issued']?.raw;
return raw ? DateTime.fromISO(raw) : DateTime.local();
return raw ? DateTime.fromISO(raw) : null;
}

get expires() {
Expand Down

0 comments on commit fbf3d5a

Please sign in to comment.