1.0.1 • Published 3 years ago

@reaxio/formatdateepoch v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

FORMAT Date EPOCH Reaxio

An Introduction

React component, easy, simple, small and improved, this is u Format Date Epoch

When To Use

When We Require to convert an Epoch Timestamp value to a date that a Human reads, is where we will need this React component.

Why Should You Use This?

Many of the components for Reactjs are in a single installation, not only the component you need and in many cases very heavy, but this is ideal for:

  1. Quick and easy loading and small
  2. They don't inject extra javascript and DOM elements into your page, making it slower.
  3. Easy to customize enough to adapt to the design of your site.
  4. Reaxion FORMAT Date EPOCH, takes up very little space, specific and simple for your project.
  5. It can be customized in any way.

📦 Install

npm i @reaxio/formatdateepoch

🔨 Usage

import FormatDateEpoch from "@reaxio/formatdateepoch";

const App = () => {

	const epochUnix = 1620584155
	const format = '%DD %d %MM %Y - %h:%m:%s %a' //Convert epoch to human-readable date

	return (
		<>
			<h3>Date is:</h3>
			<FormatDateEpoch unix={epochUnix} format={format} Intl='es' />
		</>
	)
};

✨ API

PropertyDescriptionTypeDefault
unixThe current Unix epoch time a convertNumber
formatConvert epoch to human-readable date formatstring%d.%mm.%Y
IntlProvides language sensitive string comparison, default is EnglishstringEN

  • Note 1: In props unix, if value is not valid how Date Epoch, componet return Erro Date Epoch.
  • Note 2: The value mask for prop format is next:

    	 **%d**  =returns the day of the month for the specified in param unix (1,2..30,31)
    
    	**%DD** =returns the full day of the week for the one specified in param unix ( Monday, Tuesday,...)
    
    	**%D**  =returns the shorts day of the week for the one specified in param unix ( Mon, Tue,...)
    
    	**%mm** =returns the number month in the specified param unix (01,02..11,12)
    
    	**%MM** =returns the full month  in the specified param unix (January,February..)
    
    	**%M**  =returns the short month  in the specified param unix (Jan,Feb, Mar...)
    
    	**%Y**  =returns the full year of the specified param unix (2019,2020, 2021...)
    
    	**%H**  =returns the 24 hour for the specified param unix (12,13,14...21,23)
    
    	**%h**  =returns the 12 hour for the specified param unix (12,01,02...10,11)
    
    	**%m**  =returns the minutes for the specified param unix 
    
    	**%s**  =returns the seconds for the specified param unix
    
    	**%a**  =returns the abbreviations (am) or (pm) for the specified param unix (am,pm)
  • Note 3: The props Intl, accept only ES or es = Spaning or EN or en = English.


🔺Examples

Look at our FORMAT Data EPOCH example in CodeSandox, easy, simple and fast !!!

Thanks for using it. 😃 👊🏼