changeset 150:19bab30521da

Pasando DateTime a un EditorTemplates
author Nelo@Guinea.neluz.int
date Tue, 02 Aug 2011 23:24:19 -0300
parents 157492228830
children c03c49202280
files Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj Agendas/trunk/src/Agendas.Web/Views/Evento/Agendar.cshtml Agendas/trunk/src/Agendas.Web/Views/Shared/EditorTemplates/DateTime.cshtml
diffstat 3 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj	Tue Aug 02 22:14:59 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj	Tue Aug 02 23:24:19 2011 -0300
@@ -218,6 +218,9 @@
   <ItemGroup>
     <Content Include="Views\Shared\EditorTemplates\Ponente.cshtml" />
   </ItemGroup>
+  <ItemGroup>
+    <Content Include="Views\Shared\EditorTemplates\DateTime.cshtml" />
+  </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
--- a/Agendas/trunk/src/Agendas.Web/Views/Evento/Agendar.cshtml	Tue Aug 02 22:14:59 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Web/Views/Evento/Agendar.cshtml	Tue Aug 02 23:24:19 2011 -0300
@@ -7,12 +7,6 @@
 <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
 <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
 
-<script type="text/javascript">
-	$(document).ready(function () {
-		$("#Fecha").datepicker({ dateFormat: 'dd-mm-yy' });
-	});
-</script>
-
 @using (Html.BeginForm())
 {
     @Html.ValidationSummary(true, "Los datos ingresados no son validos, por favor verifíquelos")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Agendas/trunk/src/Agendas.Web/Views/Shared/EditorTemplates/DateTime.cshtml	Tue Aug 02 23:24:19 2011 -0300
@@ -0,0 +1,7 @@
+@model DateTime?
+<script type="text/javascript">
+    $(document).ready(function () {
+        $("#@ViewData.TemplateInfo.GetFullHtmlFieldId(string.Empty)").datepicker({ dateFormat: 'dd-mm-yy' });
+    });
+</script>
+@Html.TextBox(string.Empty, (Model.HasValue ? Model.Value.ToShortDateString() : string.Empty))