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

fix(article-date-fmt): use clear date getter #1248

Merged
merged 1 commit into from
Dec 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/widgets/ReadableDate/AbsoluteFmt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ type TProps = {

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

const year = DateObj.getFullYear()
const month = DateObj.getMonth() + 1
const day = DateObj.getDate()
const hours = DateObj.getHours()
const range = calcRange(hours)
const hour = hours > 12 ? hours - 12 : hours
Expand Down