Showing posts with label yyyy. Show all posts
Showing posts with label yyyy. Show all posts

Saturday, March 24, 2012

Calender Question

Hey, All my calender inputs are done with the ajax calender control, only problem is all the dates are coming up "American-style" ie MMMM d YYYY, is there a bit of code that`ll format this correctly? i just want the date to look like (if its today for instants) 16/07/07

Thanks in advance si!

You can set the format property to "dd/MM/yy" 
<ajaxToolkit:Calendar runat="server" TargetControlID="Date1"CssClass="ClassName"Format="dd/MM/yy"PopupButtonID="Image1" />

When i went to update the test date i got the error :

The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

Is there a way of formatting the data in the database ? Si!


Here is a link that will help you to format in SQL

http://www.sql-server-helper.com/tips/date-formats.aspx

Wednesday, March 21, 2012

CalendarExtender returns date in wrong format

Hi, i'm using the CalendarExtender control within my web forms. However it keeps returning my dates in the format mm/dd/yyyy but i need it in the format dd/mm/yyyy. I was wondering if someone could tell me how this could be done. ThanksUse the Format property of the CalendarExtender.

CalendarExtender reads textbox as MM/dd/yyyy regardless of Format field.

Regardless of what I set the Format field to the CalendarExtender always reads the date from the textbox in american MM/dd/yyyy format.

My site is in NZ format dd/MM/yyyy.

Anyone know a workaround?

The problem is with the date parsing, in that I'm only currently doing new Date(dateString), which does not obey the format rules specified yet. There is no format-specific date parsing in javascript or in the AJAX core, so I will have to talk with the team to determine how best to handle this.

Picker has some more complicated parsing features I may generalize to support this, so keep an eye on the project progress while we attempt to resolvethis.


Thank you for your help. Is there any way I can work around the problem by manually altering the date the calendarextender at some event?


Hi,

I have just tested it basing on AJAX 1.0 and it works for me if I set format like dd-MM-yy and properly fill in the master text box.

Double check please if you master text box has AutoPostBack set to false.

Regards,

Adam Koszlajda