5

I am currently learning ASP.NET MVC and I have followed Stephen Walther's tutorial: ASP.NET MVC Tip #36 – Create a Popup Calendar Helper.

The calendar is working, but I would like to change the date format to dd/mm/yyyy.

Also are you able to add arrows at the top, so that the calendar can be changed by year as well as month?

2 Answers 2

14

I know this is probably for learning purposes, but a good solution already exists: JQuery UI Datepicker

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you. I used the JQuery UI DatePicker and now have the calendar working.
Is there a demo of how the DatePicker works with data from a database? For example you have a table with events in it and want to render this in the DatePicker to link to a page with the event details?
-1

index.cs

[DataType(DataType.Date)]
public string StartDate { get; set; }

index.cshtml

@Html.EditorFor(m => m.StartDate)

1 Comment

While this code may answer the question, providing additional context regarding why and/or how this code answers the question improves its long-term value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.