@annapawl/date_library

This is a date library wrapper that extends the functionality of the built-in javascript Date object.

Usage no npm install needed!

<script type="module">
  import annapawlDateLibrary from 'https://cdn.skypack.dev/@annapawl/date_library';
</script>

README

JavaScript Date Library

This is a date library wrapper that extends the functionality of the built-in javascript Date object.

Getting Started

Run the following command in your project folder:

npm install @annapawl/date_library --save

Then add this to your index.js file

require('@annapawl/src/date_library')

Date & Time Methods

year()
This method capitalizes the first letter of an entire string
'string cheese'.capitalizeFirst() → "String cheese"

yearShort()
This method capitalizes the first letter of an entire string
'string cheese'.capitalizeFirst() → "String cheese"

month()
This method capitalizes the first letter of an entire string
'string cheese'.capitalizeFirst() → "String cheese"

monthShort()
This method capitalizes the first letter of an entire string
'string cheese'.capitalizeFirst() → "String cheese"

day()
This method capitalizes the first letter of an entire string
'string cheese'.capitalizeFirst() → "String cheese"

hrs()
This method capitalizes the first letter of an entire string
'string cheese'.capitalizeFirst() → "String cheese"

mins()
This method capitalizes the first letter of an entire string
'string cheese'.capitalizeFirst() → "String cheese"

secs()
This method capitalizes the first letter of an entire string
'string cheese'.capitalizeFirst() → "String cheese"

Date Formatting Methods

'When' Method

Returns human readble description of 'when' a date will occur. Compares date owned by class instance with current date.