TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Show Financial Year using JQuery Datepicker
Rajeev Punhani
Jan 07
2016
Code
9.6
k
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
<html>
<head>
<script type=
"text/javascript"
src=
"http://code.jquery.com/jquery-1.8.3.js"
></script>
<link rel=
"stylesheet"
href=
"http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css"
/>
<script src=
"http://code.jquery.com/ui/1.9.1/jquery-ui.js"
></script>
<script type=
"text/javascript"
>
$(function()
{
var year;
$(
"#datepicker1"
).datepicker(
{
onSelect: function(dateText, inst)
{
var date = $(
this
).datepicker(
'getDate'
),
day = date.getDate(),
month = date.getMonth(),
year = date.getFullYear();
year1 = date.getFullYear();
if
(month < 3)
{
yearyear = year - 1;
year1year1 = year1.toString().substring(2);
}
else
{
yearyear = year;
year1 = (year1 + 1).toString().substring(2);;
}
$(
"#datepicker1"
).val(year +
'-'
+ year1);
},
});
});
</script>
</head>
<body>
<input type=
"text"
id=
"datepicker1"
/> </body>
</html>
Jquery
DatePicker
Financial year