Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
calender extender javascript function getdates comes like that

Thu Nov 27 2014 00:00:00 GMT+0200 (GTB Standart Saati)


I wanto to take like that: 2014-11-27

how can I convert like this 2014-11-27

what is the problem?
Posted

1 solution

give the format
ASP.NET
<asp:CalendarExtender ID="CalendarExtender1" runat="server"
          TargetControlID="TextBox1" Format="yyyy-MM-dd">
          </asp:CalendarExtender> 


Then the formatted date can be access from your textbox Text from both client side and server side.
 
Share this answer
 
v4
Comments
Member-2338430 27-Nov-14 7:45am    
same comes
DamithSL 27-Nov-14 7:48am    
how you get the date? can you show the code which you using?
Member-2338430 27-Nov-14 7:50am    
ok
Member-2338430 27-Nov-14 7:50am    
<script type="text/javascript">

function dateSelectionChanged(sender, args) {
var selectedDate = sender.get_selectedDate();


document.getElementById('<%= Page.Master.FindControl("cphIcerik").FindControl("HiddenField1").ClientID %>').value = selectedDate;
(document.getElementById('<%= Page.Master.FindControl("cphIcerik").FindControl("dummybtn").ClientID %>')).click();





}
</script>
this is script
DamithSL 27-Nov-14 7:55am    
try with
var selectedDate = sender.get_selectedDate().format(sender._format);

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900