In this article I will explain how to set or change date format in JQuery calendar control like dd/mm/yy or mm/dd/yy or DD/MM/YYYY etc. using asp.net.
In previous post I explained many articles relating to JQuery Datepicker in asp.net. Now I will explain how to change date format in JQuery calendar control like dd/mm/yy or mm/dd/yy or etc based on our requirement.
$("#txtDate").datepicker({
dateFormat: 'dd/mm/yy' });
|
$("#txtDate").datepicker({
dateFormat: 'mm/dd/yy' });
|
$("#txtDate").datepicker({
dateFormat: 'yy-mm-dd' });
|
$("#txtDate").datepicker({
dateFormat: 'd M, y' });
|
$("#txtDate").datepicker({
dateFormat: 'DD, d MM, yy' });
|
$("#txtDate").datepicker({
dateFormat: 'DD, d MM, yy' });
|
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jQuery UI Datepicker - Set Different Date Formats</title>
<link type="text/css" href="css/ui-lightness/jquery-ui-1.8.19.custom.css"
rel="stylesheet"
/>
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.19.custom.min.js"></script>
<script type="text/javascript">
$(function()
{
$("#txtDate").datepicker({
dateFormat: 'd MM, yy' });
});
</script>
<style type="text/css">
.ui-datepicker { font-size:8pt !important}
</style>
</head>
<body>
<form id="form1"
runat="server">
<div class="demo">
<b>Date:</b> <asp:TextBox ID="txtDate"
runat="server"/>
</div>
</form>
</body>
</html>
|
$(function()
{
$("#txtDate").datepicker({
dateFormat: 'd MM, yy' });
});
|
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
Subscribe by RSS
Subscribe by Email
|
|||
|
|
|


Subscribe by RSS
Subscribe by Email
6 comments :
sir, its not working under ajax:tabcontainer
very useful for me
Hi Friend,
I am Using Master Form. How to use this in the aspx form .Please Help me on this
hi friend,
plz clearly post wer add the code,i am new to .net
not working proper in update panel
Hi Sir,Its Working properly but the Previous dates are not disabled.