3.3.0 • Published 3 years ago

smltime v3.3.0

Weekly downloads
7
License
ISC
Repository
github
Last release
3 years ago

smltime

! This package is NO longer supported. Please do not use it any longer. !


This is a package to create a custom date string and to check if a FullYear is a leapyear or not.

const { leapyear, smltime } = require('smltime');

//leapyear function:
console.log(leapyear(2020)); //Expected output: true
console.log(leapyear(2021)); //Expected output: false

//smltime function:
const dateString = {
    firstDay: true,
    monthName: false,
    showDate: true,
    showHours: true,
    showMiliseconds: true,
    showMinutes: true,
    showSeconds: true,
    showTimezone: true,
    showWeekday: true,
    timezone: 'UTC'
};

console.log(smltime(dateString)); //Expected output (ONLY an example): 'Monday, 15.02.2021 00:35:07:1001 UTC'

Warning:

Version 3.0.0 and above doesn't have any language support like 2.X.X. Please remember that when you update from previous versions.

You will get an Output of true with the leapyear function, because it uses 0 as default value. You will get an TypeError, if the input for the leapyear function is not a number.

You will get an TypeError, if the input for the smltime function is not an object. If you don't define any properties in that object, the function will use this object as default: { firstDay: true, monthName: false, showDate: true, showHours: true, showMiliseconds: false, showMinutes: true, showSeconds: true, showTimezone: false, showWeekday: false, timezone: 'UTC' }


Documentation:

  • leapyear(year):

    • year: A number greater than 0
  • smltime(options):

    • options: An object to customize the output of the function
      - properties: 
          - firstDay: boolean
          - monthName: boolean
          - showDate: boolean
          - showHours: boolean
          - showMiliseconds: boolean
          - showMinutes: boolean
          - showSeconds: boolean
          - showTimezone: boolean
          - showWeekday: boolean
          - timezone: string

      A list with all possible timezones (if timezone doesn't exist it will use UTC as default):

      namedifference
      LINTUTC+14
      NZDTUTC+13
      ANATUTC+12
      AEDTUTC+11
      AESTUTC+10
      JSTUTC+9
      AWSTUTC+8
      WIBUTC+7
      BSTUTC+6
      UZTUTC+5
      GSTUTC+4
      MSKUTC+3
      EETUTC+2
      CETUTC+1
      GMTUTC+0
      UTCUTC+0
      CVTUTC-1
      GSTUTC-2
      ARTUTC-3
      VETUTC-4
      ESTUTC-5
      CSTUTC-6
      MSTUTC-7
      PSTUTC-8
      AKSTUTC-9
      HSTUTC-10
      NUTUTC-11
      AoEUTC-12

      Source: timeanddate.com

3.3.0

3 years ago

3.2.0

3 years ago

3.1.0

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago