dateutility-aslam
v0.6.0
Published
## Install
Downloads
7
Readme
React Date utility
Install
npm install dateutility-aslam
OR
yarn add dateutility-aslam
Examples for Messages grouping date
import React, { Component } from 'react';
import Dategroup from 'dateutility-aslam/Dategroup';
import {Dategroup, mDate} from 'dateutility-aslam';
Options
date={}, bg={'#000'}, text={#fff}, pd={'5px 10px'}, w={'100px'}, top={'10px'}
export default class App extends Component {
render() {
return (
<div>
allMsgs.map((item)=>{
<Dategroup date={item.time}/>
})
</div>
);
}
}
Date and time formate
import React, { Component } from 'react';
import {mDate} from 'dateutility-aslam';
For Date
{mDate(item.time).getDate()}
For Date
{mDate(item.time).getTime()}
For Time AM PM Formate
{mDate(item.time).getAMPM()}
const App = ()=> {
let itemtime = new Date();
render() {
return (
<div >
{mDate(itemtime).getAMPM()}
</div>
);
}
}
export default App
For Last Seen
let todayDate = new Date();
{mDate(todayDate).lastSeenFormat()}