mirror of
https://github.com/plankanban/planka.git
synced 2025-12-25 17:25:01 +03:00
fix: Display year when date is outside of current year (#567)
This commit is contained in:
6
client/src/utils/get-date-format.js
Normal file
6
client/src/utils/get-date-format.js
Normal file
@@ -0,0 +1,6 @@
|
||||
export default (value, longDateFormat = 'longDateTime', fullDateFormat = 'fullDateTime') => {
|
||||
const year = value.getFullYear();
|
||||
const currentYear = new Date().getFullYear();
|
||||
|
||||
return year === currentYear ? longDateFormat : fullDateFormat;
|
||||
};
|
||||
Reference in New Issue
Block a user