Giter Site home page Giter Site logo

leapfrogtechnology / nepali-date-picker Goto Github PK

View Code? Open in Web Editor NEW
81.0 13.0 62.0 592 KB

Nepali Date Picker jQuery Plugin ЁЯЗ│ЁЯЗ╡

Home Page: http://leapfrogtechnology.github.io/nepali-date-picker/demo/

License: ISC License

JavaScript 90.73% CSS 9.27%
date-picker nepali-date-picker nepali-calendar calendar datepicker hacktoberfest

nepali-date-picker's Introduction

Nepali Date Picker

NPM Version Build Status Download Count

Nepali Date Picker jQuery Plugin for everyone. ЁЯЗ│ЁЯЗ╡

Installation

npm install nepali-date-picker

Demo and Documentation

https://leapfrogtechnology.github.io/nepali-date-picker/demo/

Usage

Include jQuery, nepaliDatePicker.min.js and nepaliDatePicker.min.css in your HTML.

<!-- this should go after your </body> -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" crossorigin="anonymous"></script>
<script src="https://unpkg.com/[email protected]/dist/jquery.nepaliDatePicker.min.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/nepaliDatePicker.min.css" crossorigin="anonymous" />

Add Input Element

<input type="text" value="" name="date" class="date-picker" />

Initialize Date Picker

$('.date-picker').nepaliDatePicker({
  dateFormat: '%D, %M %d, %y',
  closeOnDateSelect: true,
  minDate: 'рд╕реЛрдо, рдЬреЗрда резреж, реирежренрей',
  maxDate: 'рдордВрдЧрд▓, рдЬреЗрда рейреи, реирежренрей'
});

Contributing

Install

npm install
npm run update

Build

npm run build

Test

npm test

nepali-date-picker's People

Contributors

dependabot[bot] avatar dipakthapaofficial avatar mesaugat avatar sagunraj avatar sanishmaharjan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nepali-date-picker's Issues

calendarFunctions doesnot work if value passed as parameter

I have a value '2019, 9, 17' as ad date, I want to convert this to bs date. The problem is:
if i run console.log(calendarFunctions.getBsDateByAdDate(2019, 9, 17));
It shows correct value but if i write
var cp = '2019, 9, 17 ';
console.log(calendarFunctions.getBsDateByAdDate(cp));
then it says invalid format. What is the issue with this ??

Bug: Date conversion from AD to BS

Date conversion fails for a specific AD month.

Step to reproduce:
calendarFunctions.getBsDateByAdDate(2018, 03, 12)

This throws "RangeError: Parameter bsMonth value should be in range of 1 to 12"

Datepicker won't hide

Datepicker won't hide when I click the document. I have to click on date in datepicker to get it hidden.

Date data wrong for 2081 jestha

In the month of jesth of 2081 there should be total 32 days in that month but there is only 31 days in your data set. Please fix this issue.

how to retrieve month and day in double digit?

is there any way that i can get dates in format of YYYY-MM-DD (реирежренрей-режреи-режрей) .... i dont find other plugins to working incredibly than this but it would be more profitable if i could generate in the format as i mentioned

Error: Property 'nepaliDatePicker' does not exist on type 'JQuery<HTMLElement>

Hey there, thanks for the datepicker,

I tried to implement it in my application, however, its throwing error on Initialize Date Picker

ts file:

$(".date-picker").nepaliDatePicker({
      dateFormat: "%D, %M %d, %y",
      closeOnDateSelect: true,
      minDate: "рд╕реЛрдо, рдЬреЗрда резреж, реирежренрей",
      maxDate: "рдордВрдЧрд▓, рдЬреЗрда рейреи, реирежренрей"
    });

HTML:

<div class="form-group">
    <input type="text" value="" name="date" class="date-picker nepalidatepicker">
</div>

Do I need to import anything in my TS file to get rid of this error?

Get date in AD on date change

Is there a way we can get date in AD on date change and input date in AD on plugin initialization or during runtime?
What I'm trying to do is, get a date in AD when user changes the date in nepali and add the date in hidden input so that I don't have to convert it in backend.

Uncaught Error: Invalid nepali number

Thank you for such good library. But i am facing an issue while editing project start date and end date.
When i supply english date directly, it is obvious to show invalid nepali number. But when i store the english start date and english end date in hidden input and later use getBsDateByAdDate function, it do not give error but the nepali calendar is not set to given date.
Can you help me with this?

My datepicker setup is like below:
description

My datepicker when providing nepali date after conversion like in setup:
date1

My datepicker date is not set according to given date input:
date2

Is there is a way to set holidays?

I use below CSS to indicate holidays, it would be awesome if I can set date range or some sort of date arrays.

/*Custom - Holiday indicator*/
<style> #ndp-nepali-box #ndp-table table td:has(a[data-value="2080-03-03"]){ background: #ff9898; } </style>
<style> #ndp-nepali-box #ndp-table table td:has(a[data-value="2080-03-04"]){ background: #ff9898; } </style>
<style> #ndp-nepali-box #ndp-table table td:has(a[data-value="2080-03-05"]){ background: #ff9898; } </style>

/*Saturday - рд╕рд╛рд░реНрдмрдЬрдирд┐рдХ bida*/
<style> 
#ndp-nepali-box #ndp-table table tr td:nth-child(7){ background: #ff3f3f; } 
#ndp-nepali-box #ndp-table table tr td:nth-child(7)>a{color:white;}
</style>

Support for time select

It would have been nicer to have time select alongside the date itself like for input type datetime-local.

cant use year and month only

i got the following error while using month and year only:

jquery.nepaliDatePicker.min.js:1 Uncaught ReferenceError: Missing required parameters: bsYear, bsMonth, bsDate

am i doing something wrong??
following is my code:

$(document).ready(function(){
    $('#nepaliDatepicker').nepaliDatePicker({
        dateFormat: "%y-%m",
        closeOnDateSelect: true
    });
    let nep_date = (calendarFunctions.getBsDateByAdDate(year, month, day));
    let nepMonth = calendarFunctions.getNepaliNumber(nep_date.bsMonth);
    let nepYear = calendarFunctions.getNepaliNumber(nep_date.bsYear);
    $('#nepaliDatepicker').val(nepYear+'-'+nepMonth);
});

Issues with nepali dates after February

The today's date and date conversion function, shows yesterday's date. I tried testing in demo app, where it shows that today's date as 19th of Chaitra Wednesday, same result for April 2, 2020 conversion.

Date ranging from 1 BS or 1000 BS?

I would like to manually input the data from 1BS or 1000 BS, it is possible?
I can provide the data and i would love to contribute too.

Issue to date converter

image

Couldnt get time to check what is going wrong. but i think this will help main dev to fix the issue quick.
Here is the issue.
image

request for feature

please if possible add a feature to calculate the age from the selected date

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.