mirror of
https://github.com/cupcakearmy/obolus.git
synced 2025-09-06 08:10:39 +00:00
client
This commit is contained in:
14
www/components/humanize.js
Normal file
14
www/components/humanize.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from 'react'
|
||||
import { Duration } from 'uhrwerk'
|
||||
|
||||
|
||||
export const timePassedSinceTimestamp = since => new Duration(Date.now() - since, 'milliseconds').humanize() + ' ago'
|
||||
|
||||
export const formatPrice = price => {
|
||||
const [int, float] = price.toFixed(2).split('.')
|
||||
return <span className={'mr-1'}>
|
||||
<b>{int}
|
||||
<small>,{float}</small>
|
||||
</b>
|
||||
</span>
|
||||
}
|
Reference in New Issue
Block a user