Skip to content

Commit

Permalink
fix: catch when time format is null (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakowenko committed Sep 11, 2021
1 parent 8273836 commit ed872dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/src/util/time.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { DateTime } = require('luxon');
const { TIMEZONE, FORMAT } = require('../constants').TIME;

module.exports.current = () => {
return FORMAT !== undefined
return FORMAT
? DateTime.now().setZone(TIMEZONE.toUpperCase()).toFormat(FORMAT)
: DateTime.now().setZone(TIMEZONE.toUpperCase()).toString();
};
Expand Down

0 comments on commit ed872dd

Please sign in to comment.