time-convertor-ts

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

commit 8759aaf729391265b9b1b72b299c9459a080190e
parent ba480443d404b785b154642003473de83abbdf40
Author: Agastya Chandrakant <acagastya@outlook.com>
Date:   Sun, 24 May 2020 23:58:39 +0530

Footer update + some util functions

Diffstat:
Msrc/App/comps/Footer.tsx | 18++++++++++++++----
Msrc/utils/index.ts | 18++++++++++++++++++
2 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/src/App/comps/Footer.tsx b/src/App/comps/Footer.tsx @@ -5,7 +5,7 @@ import { YEAR } from '../../utils'; function Footer<never>(): JSX.Element { return ( <footer - className="bottom-top page-footer" + className="border-top mt-5 page-footer" style={{ bottom: 0, paddingTop: '1rem', @@ -15,9 +15,19 @@ function Footer<never>(): JSX.Element { <div className="text-center"> <p> Copyright &copy; {YEAR}{' '} - <a href="https://en.wikinews.org/wiki/User:Acagastya">Agastya</a>. - This project is licensed under{' '} - <a href="https://opensource.org/licenses/BSD-3-Clause"> + <a + href="https://en.wikinews.org/wiki/User:Acagastya" + target="_blank" + rel="noopener noreferrer" + > + Agastya + </a> + . This project is licensed under{' '} + <a + href="https://opensource.org/licenses/BSD-3-Clause" + target="_blank" + rel="noopener noreferrer" + > BSD-3-Clause license </a> . diff --git a/src/utils/index.ts b/src/utils/index.ts @@ -1,5 +1,23 @@ +import moment from 'moment-timezone'; + +/** + * @description Convert a string like `foo_bar_baz` to `foo bar baz` + * @param {string} str + */ +function friendlyStr(str: string): string { + return str.replace(/_/g, ' '); +} + +export { + friendlyStr +}; + +const DEFAULT_TZ = 'UTC'; +const localTimezone = moment.tz.guess(); const YEAR = new Date().getFullYear(); export { + DEFAULT_TZ, + localTimezone, YEAR }; \ No newline at end of file