npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rwa-time

v1.0.3

Published

Get current date or format other dates to Kinyarwanda (rw).

Downloads

23

Readme

rwa-time

Build Status npm Dependency Status

NPM

Get current date in Kinyarwanda (rw) or format other dates to Kinyarwanda (rw).

Table of content


Installation

via npm:

npm i -S rwa-time

via yarn:

yarn add rwa-time

Scripts

view all available functions:

yarn all
npm run all

Usage

const RwaTime = require("rwa-time");
const date = new RwaTime();

console.log(date.getFullDate()); // 01, Ukuboza 2019

Date Functions

All functions below receive an optional date as a parameter. If no date is passed the function uses the current date.

  • {string} date - accepts various formats (optional)

e.g.:

date.getDateTime('05/07/2019 08:54:32') // => 07/05/2019 Saa Mbiri n'iminota 54 n'amasegonda 32

date.getTime('05/07/2019 08:54:32') // => Saa Mbiri n'iminota 54 n'amasegonda 32

date.getDate('October 15, 1996 05: 35: 32') // => 15/10/1996

date.getFullWeekdayDate('2017-09-08T15:25:53Z') // => Kuwa Gatanu, Taliki ya 08 z'ukwa Cyenda 2017

date.getMonthNumber('05 October 2011 14:48 UTC') // => 10

date.getDateTime('07/24/2015') // => 24/07/2015 Saa Sita n'iminota 00 n'amasegonda 00

date.getWeekdayNumber('05 October 2011 14:48 UTC') // => 4

date.getWeekday('05 October 2011 14:48 UTC') // => Kuwa Gatatu

date.getTime('Wed Sept 05 2011 16:48:00 GMT+0200 (CEST)' // => Saa Kumi n'iminota 48 n'amasegonda 00

date.getDay('20HJERH87LK4') // => Invalid Date

If the date passed is invalid, functions will return 'Invalid Date'.

getDay(date)

  • returns day (01 a 31)
let dt = date.getDay(); // => 01

getMonthNumber(date)

  • returns month number (01 a 12)
let dt = date.getMonthNumber(); // => 10

getMonth(date)

let dt = date.getMonth(); // => Ukuboza

| number | month | | :----- | :---------- | | 01 | Mutarama | | 02 | Gashyantare | | 03 | Werurwe | | 04 | Mata | | 05 | Gicurasi | | 06 | Kamena | | 07 | Nyakanga | | 08 | Kanama | | 09 | Nzeri | | 10 | Ukwakira | | 11 | Ugushyingo | | 12 | Ukuboza |

getYear(date)

let dt = date.getYear(); // => 2019

getWeekdayNumber(date)

  • returns the number of the week (1 a 7)
let dt = date.getWeekdayNumber(); // => 1

getWeekday(date)

let dt = date.getWeekday(); // => Ku Cyumweru

| number | weekday | | :----- | :------------- | | 1 | Ku Cyumweru | | 2 | Kuwa Mbere | | 3 | Kuwa Kabiri | | 4 | Kuwa Gatatu | | 5 | Kuwa Kane | | 6 | Kuwa Gatanu | | 7 | Kuwa Gatandatu |

getDate(date)

let dt = date.getDate(); // => 01/12/2019

getFullDate(date)

let dt = date.getFullDate(); // => 01, Ukuboza 2019

getFullWeekdayDate(date)

let dt = date.getFullWeekdayDate(); // =>  Ku Cyumweru, Taliki ya 01 z'ukwa Cumi Na Kabiri 2019

getMonthNumberYear(date)

let dt = date.getMonthNumberYear(); // => 12/2019

getMonthYear(date)

let dt = date.getMonthYear(); // => Ukuboza/2019

getHour(date)

  • return hours (01 a 23)
let dt = date.getHour(); // => Saa Munani

getTime(date)

let dt = date.getTime(); // => Saa Munani n'iminota 48 n'amasegonda 00

getMinute(date)

  • return minutes (01 a 59)
let dt = date.getMinute(); // => 48

getFullMinute(date)

let dt = date.getFullMinute(); // => iminota 48

getSecond(date)

  • returns seconds (01 a 59)
let dt = date.getSecond(); // => 00

getFullSecond(date)

let dt = date.getFullSecond(); // => amasegonda 00

getHourMinute(date)

let dt = date.getHourMinute(); // => Saa Munani n'iminota 48

getDateTime(date)

let dt = date.getDateTime(); // => 24/07/2015 Saa Sita n'iminota 00 n'amasegonda 00

getFullCityDate(date)

asynchronous function

let cty = await date.getFullCityDate(); // =>  Kigali, 01 Ukuboza, 2019

getFullShortCountryDate(date)

asynchronous function

let dt = await date.getFullShortCountryDate(); // =>  RW, 01 Ukuboza 2019

Current Locale Functions

All functions bellow are asynchronous and returns current locale informations.

getCity()

asynchronous function

let dt = await date.getCity(); // => Kigali

getRegion()

asynchronous function

let dt = await date.getRegion(); // => Kigali

getCountry()

asynchronous function

let dt = await date.getCountry(); // => Rwanda

getShortCountry()

asynchronous function

let dt = await date.getShortCountry(); // => RW

getTimezone()

asynchronous function

let dt = await date.getTimezone(); // => Africa/Kigali

License

MIT License

Copyright (c) 2019 Igwaneza Bruce

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.