Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7599637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:42:39+00:00 2026-05-30T22:42:39+00:00

Dudes, been trying for very long time on solving this. I have been looking

  • 0

Dudes, been trying for very long time on solving this. I have been looking around and been fiddling around but i just cant get it to work!!

For my DOB, im hoping to accept date in dd/mm/yyyy.. however it only accepts mm/dd/yyyy. Where should i make the fix?

I got inspirations from Jquery Datepicker 1 and Jquery Datepicker 2.

In my Model

[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
[Display(Name = "Date of Birth")]
public DateTime DOB { get; set; }

In my View, pretty straight forward

@Html.EditorFor(model => model.DOB)

Have an Editor Template that is called up whenever date is used.

@model DateTime?

@Html.TextBox("", Model != null ? Model.Value.ToString("dd/mm/yyyy") : "", new { @class   = "date" })

Wrote another editorhookup, that refs Jquery

$(document).ready(function () {
$('.date').datepicker({ dateFormat: "dd/mm/yy" });
});

Any help is appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:42:40+00:00Added an answer on May 30, 2026 at 10:42 pm

    Where should i make the fix?

    In your editor template:

    @Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, new { @class = "date" })
    

    That’s for displaying the date in the correct format.

    For binding the value back in a POST controller action you could write a custom model binder that will use the [DisplayFormat] attribute to parse the value back to a valid DateTime instance using the specified format.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey dudes.i am having this problem while symlinking. I have successfully deployed a ruby
Hey all - I've been googling this as much as possible, but nothing I
dudes, does any of you know how to do this? i have a page
I have been trying to change the contents of a div which I receive
I have searched and searched for a solution to this problem, but it seems
Hey dudes, I have the following function: $.fn.slideOut = function(speed,dir) { this.animate({ dir: '-1000px'
I have looked for dupes of this but forgive me if I missed a
How going, dudes? So today it's a really ridiculous question, but i just can't
I'm new to CouchDB and document-oriented databases in general. I've been playing around with
I was turned on to nstrees from another question, and have been working through

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.