Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model editor does not display Start Date #77

Open
plwade opened this issue Mar 1, 2013 · 6 comments
Open

Model editor does not display Start Date #77

plwade opened this issue Mar 1, 2013 · 6 comments

Comments

@plwade
Copy link

plwade commented Mar 1, 2013

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

@erichexter
Copy link
Owner

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//issues/77
.

@plwade
Copy link
Author

plwade commented Mar 3, 2013

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//issues/77

.


Reply to this email directly or view it on GitHub.

@serra
Copy link
Contributor

serra commented Mar 4, 2013

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.

@plwade
Copy link
Author

plwade commented Mar 4, 2013

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.

@serra
Copy link
Contributor

serra commented Mar 4, 2013

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
Copy link
Contributor

serra commented Mar 4, 2013

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants