Email: info@zenconix.com

Datepicker in jquery

Published on: 12/5/13 5:29 PM

Category:Code Tags:

Hi there !

I have gone through some problem , this may not be very tough but I have spend more time on that so I think solution should publish

Requirement was something like as follows

for datepicker

for datepicker I have simply code as

[sourcecode language=”csharp”]
$("#date") .datepicker();
[/sourcecode]

but some conditions as

1) add months and years dropdown to the datepicker

so for that I have added some functions there

[sourcecode language=”csharp”]
changeYear:true,

changeMonth:true
[/sourcecode]

2) now the tough part comes here

by default jquery takes year as 2002 to 2012

but I need to have years from 1990 to 2012 so  I have started searching

and I found that

[sourcecode language=”csharp”]
yearRange: "1990:2012"
[/sourcecode]

3) Now I have to perform some action on close of that datepicker so I need some function on close event of the datepicker

I could have 2 function 1) onClose 2) onSelect any one I could take

so have taken onClose function and could added some functionality

[sourcecode language=”csharp”]
onClose: function () {
// some code
}
[/sourcecode]

You can have demo here
Show More


Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

How Angular Application starts?

In this post we are going to take look on how angular application starts. For any angular application, entry point is index.html. In index.html file there is tag called as <app-root> In main.ts file <app-root> selector is picked up by the AppModule. Below is code snippet from main.ts file AppModule is module which is bootstrapped […]

Learn C# – Namespaces

What is Namespaces in C#? C# Programs are organized using namespaces. Namespaces are used to add separation of Code in C#. Namespaces can have following members inside it. Namespaces (nested) Classes Interface Delegates Structures Why to use Namespaces? Code Separation: With help of Namespaces, you can separate out set of code in C# Project.Example: if […]

Steps by step procedure to connect the database to Lumen

Create database in phpmyadmin Open .env file. NOTE: if .env file is with name, .env.sample, then rename it to .env Change following parameter in file DB_DATABASE=lumen DB_USERNAME=root DB_PASSWORD= Also check for following parameters if they are different than default setting DB_HOST=127.0.0.1 DB_PORT=3306 Next, as we are going to use Eloquent ORM, we need to un-comment […]