twitter.bootstrap.mvc icon indicating copy to clipboard operation
twitter.bootstrap.mvc copied to clipboard

Model editor does not display Start Date

Open plwade opened this issue 11 years ago • 6 comments

Hi Eric, I'm having problems getting the model Edit to work showing the existing Start Date (see attached screenshot).

Also..... Is it possible to have dates edited with a Calendar DatePicker rather than a TextBox?

Any help appreciated.

Regards, Paul Screenshot

plwade avatar Mar 01 '13 21:03 plwade

You can create a editor template using the out of the box mvc functionality

Eric Hexter

blog | http://Hex.LosTechies.com info | http://www.linkedin.com/in/erichexter

On Fri, Mar 1, 2013 at 3:38 PM, plwade [email protected] wrote:

Hi Eric, I'm having problems getting the model Edit to work showing the existing Start Date (see attached screenshot).

Also..... Is it possible to have dates edited with a Calendar DatePicker rather than a TextBox?

Any help appreciated.

Regards, Paul [image: Screenshot]https://f.cloud.github.com/assets/3742666/211510/245fee8c-82b8-11e2-8cc7-57d956cda2c4.jpg

— Reply to this email directly or view it on GitHubhttps://github.com/erichexter/twitter.bootstrap.mvc/issues/77 .

erichexter avatar Mar 01 '13 22:03 erichexter

Hi Eric, Thanks for getting back to me. re. create a editor template - Does this mean there is a problem with the example application regarding the display/edit of the Start date? I really would like to get the example app working, so any help appreciated. Regards, Paul.

Date: Fri, 1 Mar 2013 14:39:43 -0800 From: [email protected] To: [email protected] CC: [email protected] Subject: Re: [twitter.bootstrap.mvc] Model editor does not display Start Date (#77)

You can create a editor template using the out of the box mvc functionality

Eric Hexter

blog | http://Hex.LosTechies.com

info | http://www.linkedin.com/in/erichexter

On Fri, Mar 1, 2013 at 3:38 PM, plwade [email protected] wrote:

Hi Eric, I'm having problems getting the model Edit to work showing the

existing Start Date (see attached screenshot).

Also..... Is it possible to have dates edited with a Calendar DatePicker

rather than a TextBox?

Any help appreciated.

Regards, Paul

[image: Screenshot]https://f.cloud.github.com/assets/3742666/211510/245fee8c-82b8-11e2-8cc7-57d956cda2c4.jpg

Reply to this email directly or view it on GitHubhttps://github.com/erichexter/twitter.bootstrap.mvc/issues/77

.

— Reply to this email directly or view it on GitHub.

plwade avatar Mar 03 '13 20:03 plwade

I'll post an example how to do this later today (not at all difficult); not sure if it should be part of the project though. IMO there's no "problem" regarding the editing of datetime fields - it's just not implemented. And since Twitter.Bootstrap doesn't provide a date(time)picker (afaik) it shouldn't be. You can use whatever datetime picker you find fit with this project.

serra avatar Mar 04 '13 07:03 serra

Hi Marjin, I'll keep an eye out for your post. Thanks for getting back to me so soon. Regards, Paul. Date: Sun, 3 Mar 2013 23:20:00 -0800 From: [email protected] To: [email protected] CC: [email protected] Subject: Re: [twitter.bootstrap.mvc] Model editor does not display Start Date (#77)

I'll post an example how to do this later today (not at all difficult); not sure if it should be part of the project though. IMO there's no "problem" regarding the editing of datetime fields - it's just not implemented. And since Twitter.Bootstrap doesn't provide a date(time)picker (afaik) it shouldn't be. You can use whatever datetime picker you find fit with this project.

— Reply to this email directly or view it on GitHub.

plwade avatar Mar 04 '13 10:03 plwade

The HomeInputModel.StartDate is annotated with DataType.Date, which renders an input typed Date. Some browsers render a datepicker, but some others don't. If you want to guarantee a date picker, you can create an editor in ~/Views/Shared/EditorTemplates named Date.cshtml and hook this to your preferred datepicker (I chose bootstrap-datepicker). Content of Date.cshtml:

@model DateTime
@Html.TextBox("", Model, new {@class = "datepicker"})

For more details, see my blog post

serra avatar Mar 04 '13 15:03 serra

@plwade - I don't think support for custom editors should be added to this project. If you agree and the above approach works for you, please close this issue.

serra avatar Mar 04 '13 15:03 serra