date-time-helper
Usage
Node environment
Install
npm install js-date-time-helper
Usage
import { DateTimeHelper } from "js-date-time-helper";
console.log(DateTimeHelper.getTodayYearMonthData());
Browser environment
Add this script in the body of html.
<script src="https://www.unpkg.com/js-date-time-helper@version/out/date-time-helper.js"></script>
Use this way in js files.
Dispatch.DateTimeHelper.getTodayYearMonthData()
Available methods
getTodayYearMonthData
Format: 2021-09-27
getThisWeekRange
Format [ 'Sep 26, 2021', 'Oct 02, 2021' ]
getMonthDateYearBeutify
Input: Date
Output: Sep 27, 2021
getMonthFromNumber
Input: 1
Output: Jan
getBrowserTimeZoneOffset
Output: "+06:00:00"
getHourMinuteSecondFromSeconds
Input: 3670
Output: "01:01:10"
Input: 259635
Output: "72:07:15"
getHourMinuteFromMin
Input: 259635
Output: "4327 Hours 15 Mins"
Input: 1256
Output: "20 Hours 56 Mins"