• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

timeago-react: :clock8: Simple and efficient react component to format date with ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

timeago-react

开源软件地址:

https://gitee.com/hustcc/timeago-react

开源软件介绍:

timeago-react

timeago-react is a simple react component used to format date with *** time ago statement. eg: '3 hours ago'.

The component based on timeago.js which is a simple javascript module.

  • Realtime render. Automatic release the resources.
  • Simple. Only 2kb.
  • Efficient. When the time is 3 hour ago, the interval will an hour (3600 * 1000 ms).
  • Locales supported.

Build Status npm npm npm

1. install

npm install timeago-react

2. usage

import React from 'react';import TimeAgo from 'timeago-react'; // var TimeAgo = require('timeago-react');<TimeAgo  datetime={'2016-08-08 08:08:08'}   locale='zh_CN' />

3. component props

  • datetime (required, string / Date / timestamp)

The datetime to be formated. can be datetime string, Date instance, or timestamp.

  • live (optional, boolean)

Live render, default is true.

  • className (optional, string)

The class of span. you can setting the css style of span by class name.

  • locale (optional, string)

The locale language of statement, default is en. All supported locales here.

4. LICENSE

MIT


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap