Giter VIP home page Giter VIP logo

datetime-nepali-fe's Introduction

Nepali DateTime Converter

This is a fork of nepali-datetime converter with fixes on particular date and added fuctionality

A javascript package to convert nepali date BS (Bikram Sambat) to AD and vice-versa. Also include a feature to calculate age in nepali date.

Installation

npm install datetime-nepali-fe

Usage

const { adToBs, bsToAd, calculateAge } = require('datetime-nepali-fe');
try {
	const bsDate = adToBs('2078-03-05');
	console.log(bsDate);
	// to calculate age
	const myAge = calculateAge('2070-10-10');
	console.log(myAge);
} catch (e) {
	console.log(e.message);
}

Available Methods

adToBs('YYYY-MM-DD') - convert AD to BS date
bsToAd('YYYY-MM-DD') - convert BS to AD date
calculateAge('YYYY-MM-DD') - calculate age from BS date.

dateFormat

Format the date to provide various output based on format string

YYYY - 4 digit of year (2078)
MM   - month number with 0 padding - (01-12)
DD   - Day of Month with zero padding (01-32)

Date Range

Date convert will works between these Date Range:

Date Range for English Date : 1921 AD to 2040 AD

Date Range for Nepali Date : 1978 BS to 2099 BS

License

MIT © [Hukum Gosain]

datetime-nepali-fe's People

Contributors

sbmdkl avatar 44hukum avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.