- {t('format:longDateTime', {
+ {t(`format:${dateFormat}`, {
postProcess: 'formatDate',
value: createdAt,
})}
diff --git a/client/src/components/CardModal/Activities/ItemComment.jsx b/client/src/components/CardModal/Activities/ItemComment.jsx
index 488f0d8..26f27ed 100755
--- a/client/src/components/CardModal/Activities/ItemComment.jsx
+++ b/client/src/components/CardModal/Activities/ItemComment.jsx
@@ -16,6 +16,10 @@ const ItemComment = React.memo(
({ data, createdAt, isPersisted, user, canEdit, onUpdate, onDelete }) => {
const [t] = useTranslation();
+ const thisYear = new Date().getFullYear();
+ const targetYear = createdAt.getFullYear();
+ const dateFormat = (targetYear == thisYear) ? "longDateTime" : "fullDateTime";
+
const commentEdit = useRef(null);
const handleEditClick = useCallback(() => {
@@ -33,7 +37,7 @@ const ItemComment = React.memo(
{user.name}
- {t('format:longDateTime', {
+ {t(`format:${dateFormat}`, {
postProcess: 'formatDate',
value: createdAt,
})}
diff --git a/client/src/components/DueDate/DueDate.jsx b/client/src/components/DueDate/DueDate.jsx
index e36fa25..c01eb88 100644
--- a/client/src/components/DueDate/DueDate.jsx
+++ b/client/src/components/DueDate/DueDate.jsx
@@ -18,9 +18,19 @@ const FORMATS = {
medium: 'longDateTime',
};
+const OTHERWISE_FORMATS = {
+ tiny: 'fullDate',
+ small: 'fullDate',
+ medium: 'fullDateTime',
+};
+
const DueDate = React.memo(({ value, size, isDisabled, onClick }) => {
const [t] = useTranslation();
+ const thisYear = new Date().getFullYear();
+ const targetYear = value.getFullYear();
+ const dateFormats = (targetYear == thisYear) ? FORMATS : OTHERWISE_FORMATS;
+
const contentNode = (
{
onClick && styles.wrapperHoverable,
)}
>
- {t(`format:${FORMATS[size]}`, {
+ {t(`format:${dateFormats[size]}`, {
value,
postProcess: 'formatDate',
})}
diff --git a/client/src/locales/cs/core.js b/client/src/locales/cs/core.js
index f32a580..04dfc8d 100644
--- a/client/src/locales/cs/core.js
+++ b/client/src/locales/cs/core.js
@@ -9,6 +9,8 @@ export default {
dateTime: '$t(format:date) $t(format:time)',
longDate: 'd MMM',
longDateTime: "d MMMM 'v' p",
+ fullDate: 'd MMM, y',
+ fullDateTime: "d MMMM, y 'v' p",
},
translation: {
diff --git a/client/src/locales/da/core.js b/client/src/locales/da/core.js
index 7793d4e..93e7096 100644
--- a/client/src/locales/da/core.js
+++ b/client/src/locales/da/core.js
@@ -9,6 +9,8 @@ export default {
dateTime: '$t(format:date) $t(format:time)',
longDate: 'MMM d',
longDateTime: "MMMM d 'at' p",
+ fullDate: 'MMM d, y',
+ fullDateTime: "MMMM d, y 'a' p",
},
translation: {
diff --git a/client/src/locales/de/core.js b/client/src/locales/de/core.js
index 4389df0..0b743de 100644
--- a/client/src/locales/de/core.js
+++ b/client/src/locales/de/core.js
@@ -9,6 +9,8 @@ export default {
dateTime: '$t(format:date) $t(format:time)',
longDate: 'd. MMM',
longDateTime: "d. MMMM 'um' p",
+ fullDate: 'd. MMM. y',
+ fullDateTime: "d. MMMM. y 'um' p",
},
translation: {
diff --git a/client/src/locales/en/core.js b/client/src/locales/en/core.js
index 10c40a6..83b0116 100644
--- a/client/src/locales/en/core.js
+++ b/client/src/locales/en/core.js
@@ -5,6 +5,8 @@ export default {
dateTime: '$t(format:date) $t(format:time)',
longDate: 'MMM d',
longDateTime: "MMMM d 'at' p",
+ fullDate: 'MMM d, y',
+ fullDateTime: "MMMM d, y 'at' p",
},
translation: {
diff --git a/client/src/locales/es/core.js b/client/src/locales/es/core.js
index e7e2d8d..a0b1260 100644
--- a/client/src/locales/es/core.js
+++ b/client/src/locales/es/core.js
@@ -9,6 +9,8 @@ export default {
dateTime: '$t(format:date) $t(format:time)',
longDate: 'MMM d',
longDateTime: "MMMM d 'a' p",
+ fullDate: 'MMM d, y',
+ fullDateTime: "MMMM d, y 'a' p",
},
translation: {
diff --git a/client/src/locales/fr/core.js b/client/src/locales/fr/core.js
index 81f43cb..e20e291 100644
--- a/client/src/locales/fr/core.js
+++ b/client/src/locales/fr/core.js
@@ -9,6 +9,8 @@ export default {
dateTime: '$t(format:date) $t(format:time)',
longDate: 'd MMM',
longDateTime: "d MMMM 'à' p",
+ fullDate: 'd MMM y',
+ fullDateTime: "d MMMM y 'à' p",
},
translation: {
diff --git a/client/src/locales/it/core.js b/client/src/locales/it/core.js
index 0241da6..f08a946 100644
--- a/client/src/locales/it/core.js
+++ b/client/src/locales/it/core.js
@@ -5,6 +5,8 @@ export default {
dateTime: '$t(format:date) $t(format:time)',
longDate: 'MMM d',
longDateTime: "MMMM d 'at' p",
+ fullDate: 'MMM d, y',
+ fullDateTime: "MMMM d, y 'at' p",
},
translation: {
diff --git a/client/src/locales/ja/core.js b/client/src/locales/ja/core.js
index 56a1776..560e8ec 100644
--- a/client/src/locales/ja/core.js
+++ b/client/src/locales/ja/core.js
@@ -9,6 +9,8 @@ export default {
dateTime: '$t(format:date) $t(format:time)',
longDate: 'MMMMd日',
longDateTime: "MMMMd'日 ' HH:mm",
+ fullDate: 'yyyy年M月d日',
+ fullDateTime: "yyyy年M月d日 HH:mm",
},
translation: {
diff --git a/client/src/locales/ko/core.js b/client/src/locales/ko/core.js
index 834c8d3..c1d676a 100644
--- a/client/src/locales/ko/core.js
+++ b/client/src/locales/ko/core.js
@@ -9,6 +9,9 @@ export default {
dateTime: '$t(format:date) $t(format:time)',
longDate: "MMMMd'일'",
longDateTime: "MMMMd'일 ' a hh시 mm분",
+ fullDate: "yyyy년M월d일",
+ fullDateTime: "yyyy년M월d일 a hh시 mm분",
+
},
translation: {
diff --git a/client/src/locales/pl/core.js b/client/src/locales/pl/core.js
index 0acc266..54ac306 100644
--- a/client/src/locales/pl/core.js
+++ b/client/src/locales/pl/core.js
@@ -9,6 +9,8 @@ export default {
dateTime: '$t(format:date) $t(format:time)',
longDate: 'd MMM',
longDateTime: "d MMMM 'o' p",
+ fullDate: 'd MMM y',
+ fullDateTime: "d MMMM y 'o' p",
},
translation: {
diff --git a/client/src/locales/ro/core.js b/client/src/locales/ro/core.js
index c9b9e9d..2e19922 100644
--- a/client/src/locales/ro/core.js
+++ b/client/src/locales/ro/core.js
@@ -9,6 +9,8 @@ export default {
dateTime: '$t(format:date) $t(format:time)',
longDate: 'd MMM',
longDateTime: "d MMMM 'в' p",
+ fullDate: 'd MMM y',
+ fullDateTime: "d MMMM y 'в' p",
},
translation: {
diff --git a/client/src/locales/ru/core.js b/client/src/locales/ru/core.js
index 1937103..138b893 100644
--- a/client/src/locales/ru/core.js
+++ b/client/src/locales/ru/core.js
@@ -9,6 +9,8 @@ export default {
dateTime: '$t(format:date) $t(format:time)',
longDate: 'd MMM',
longDateTime: "d MMMM 'в' p",
+ fullDate: 'd MMM y',
+ fullDateTime: "d MMMM y 'в' p",
},
translation: {
diff --git a/client/src/locales/sk/core.js b/client/src/locales/sk/core.js
index 574be43..b371630 100644
--- a/client/src/locales/sk/core.js
+++ b/client/src/locales/sk/core.js
@@ -9,6 +9,8 @@ export default {
dateTime: '$t(format:date) $t(format:time)',
longDate: 'd MMM',
longDateTime: "d MMMM 'v' p",
+ fullDate: 'd MMM y',
+ fullDateTime: "d MMMM y 'v' p",
},
translation: {
diff --git a/client/src/locales/sv/core.js b/client/src/locales/sv/core.js
index 1b43e13..0f7b37f 100644
--- a/client/src/locales/sv/core.js
+++ b/client/src/locales/sv/core.js
@@ -9,6 +9,8 @@ export default {
dateTime: '$t(format:date) $t(format:time)',
longDate: 'MMM d',
longDateTime: "MMMM d 'at' p",
+ fullDate: 'MMM d, y',
+ fullDateTime: "MMMM d, y 'at' p",
},
translation: {
diff --git a/client/src/locales/tr/core.js b/client/src/locales/tr/core.js
index bd267c0..b04cd21 100644
--- a/client/src/locales/tr/core.js
+++ b/client/src/locales/tr/core.js
@@ -9,6 +9,8 @@ export default {
dateTime: '$t(format:date) $t(format:time)',
longDate: 'd. MMM',
longDateTime: "d. MMMM 'Saat' p",
+ fullDate: 'd. MMM. y',
+ fullDateTime: "d. MMMM. y 'Saat' p",
},
translation: {
diff --git a/client/src/locales/uz/core.js b/client/src/locales/uz/core.js
index cc2c52e..084de78 100644
--- a/client/src/locales/uz/core.js
+++ b/client/src/locales/uz/core.js
@@ -5,6 +5,8 @@ export default {
dateTime: '$t(format:date) $t(format:time)',
longDate: 'MMM d',
longDateTime: "MMMM d 'at' p",
+ fullDate: 'MMM d, y',
+ fullDateTime: "MMMM d, y 'at' p",
},
translation: {
diff --git a/client/src/locales/zh/core.js b/client/src/locales/zh/core.js
index c381a88..643bb4e 100644
--- a/client/src/locales/zh/core.js
+++ b/client/src/locales/zh/core.js
@@ -5,6 +5,8 @@ export default {
dateTime: '$t(format:date) $t(format:time)',
longDate: 'MMM d',
longDateTime: "MMMM d 'at' p",
+ fullDate: 'MMM d, y',
+ fullDateTime: "MMMM d, y 'at' p",
},
translation: {