time-convertor

Convert time across timezones
git clone http://git.hanabi.in/repos/time-convertor.git
Log | Files | Refs | README | LICENSE

commit a87bee07a9f4a225e966e2c30adfd15a846cc3f6
parent 78a8fa3b8272a4891430a1da1f117a8b7dd953a7
Author: Agastya Chandrakant <me@hanabi.in>
Date:   Mon, 18 May 2020 10:22:06 +0530

add

Diffstat:
Asrc/comp/fromToTime.js | 39+++++++++++++++++++++++++++++++++++++++
Msrc/subpages/fromTo.js | 4+++-
2 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/src/comp/fromToTime.js b/src/comp/fromToTime.js @@ -0,0 +1,39 @@ +import React from 'react'; +import moment from 'moment-timezone'; + +function AutoCompleteFrom() { + return 'from'; +} + +function AutoCompleteTo() { + return 'To'; +} + +function FromToTime() { + return ( + <div className="time-conversion"> + <div className="row mb-3" id="labels"> + <div className="col" id="from-time-lbl-box"> + <AutoCompleteTo defaultValue={fromTZ} changeValue={setFromTZ} /> + </div> + <div className="col" id="to-time-lbl-box"> + <AutoCompleteFrom defaultValue={toTZ} changeValue={setToTZ} /> + </div> + </div> + <div className="row" id="times"> + <div className="col text-right" id="from-time-box"> + <h4 aria-level="4" id="from-time"> + {nowMoment.tz(fromTZ).format('HH:mm:ss MMM DD, YYYY')} ({fromAbbr}) + </h4> + </div> + <div className="col" id="to-time-box"> + <h4 aria-level="4" id="to-time"> + {nowMoment.tz(toTZ).format('HH:mm:ss MMM DD, YYYY')} ({toAbbr}) + </h4> + </div> + </div> + </div> + ); +} + +export default FromToTime; diff --git a/src/subpages/fromTo.js b/src/subpages/fromTo.js @@ -1,5 +1,7 @@ import React from 'react'; +import FromToTime from '../comp/fromToTime'; + import Footer from '../comp/footer'; import Header from '../comp/header'; @@ -10,7 +12,7 @@ function FromTo() { style={{ maxWidth: '100vw', overflow: 'hidden', padding: 0 }} > <Header /> - from-to + <FromToTime /> <Footer /> </div> );