Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit c0b093a

Browse files
authored
fix(article-date-fmt): use clear date getter (#1248)
1 parent bc13cd2 commit c0b093a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/widgets/ReadableDate/AbsoluteFmt.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ type TProps = {
1717

1818
const AbsoluteFmt: FC<TProps> = ({ datetime, className, withTime }) => {
1919
const DateObj = new Date(datetime)
20-
const [year, month, day] = DateObj.toLocaleDateString().split('/')
2120

21+
const year = DateObj.getFullYear()
22+
const month = DateObj.getMonth() + 1
23+
const day = DateObj.getDate()
2224
const hours = DateObj.getHours()
2325
const range = calcRange(hours)
2426
const hour = hours > 12 ? hours - 12 : hours

0 commit comments

Comments
 (0)