fix problemi calendario date
This commit is contained in:
@@ -5,9 +5,9 @@
|
||||
<td>
|
||||
<div>
|
||||
<asp:Label runat="server" ID="lblData" /></div>
|
||||
<asp:TextBox runat="server" ID="txtData" Width="5em" CssClass='<%# css %>' />
|
||||
<asp:TextBox runat="server" ID="txtData" Width="6em" CssClass='<%# css %>' />
|
||||
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" FirstDayOfWeek="Monday"
|
||||
TargetControlID="txtData" Format="dd/MM/yy">
|
||||
TargetControlID="txtData"><%--Format="yyyy/MM/dd"--%>
|
||||
</cc1:CalendarExtender>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
using System.Globalization;
|
||||
|
||||
[ValidationProperty("valore")]
|
||||
public partial class mod_dataOra : System.Web.UI.UserControl
|
||||
@@ -37,6 +38,7 @@ public partial class mod_dataOra : System.Web.UI.UserControl
|
||||
fixPnlVisibility();
|
||||
//setupControlli();
|
||||
fixCss();
|
||||
CalendarExtender1.Format = memLayer.ML.CRS("ddMMyyyy");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@@ -55,7 +57,7 @@ public partial class mod_dataOra : System.Web.UI.UserControl
|
||||
private void setupControlli()
|
||||
{
|
||||
// mostro data
|
||||
txtData.Text = _valore.Date.ToString("dd/MM/yy");
|
||||
txtData.Text = _valore.Date.ToString(memLayer.ML.CRS("ddMMyyyy"));
|
||||
switch (_tipoOrario)
|
||||
{
|
||||
case tipoSelOrario.tendina:
|
||||
@@ -157,7 +159,13 @@ public partial class mod_dataOra : System.Web.UI.UserControl
|
||||
min = Convert.ToDateTime(txtTime.Text).Minute;
|
||||
break;
|
||||
}
|
||||
DateTime answ = Convert.ToDateTime(txtData.Text).AddHours(ora).AddMinutes(min);
|
||||
string formato = memLayer.ML.CRS("ddMMyyyy");
|
||||
DateTime valore;
|
||||
CultureInfo enUS = new CultureInfo(memLayer.ML.CRS("culture"));
|
||||
logger.lg.scriviLog(string.Format("Valore txt:{1}{0}", Environment.NewLine, txtData.Text), tipoLog.INFO);
|
||||
DateTime.TryParseExact(txtData.Text, formato, enUS, DateTimeStyles.None, out valore);
|
||||
logger.lg.scriviLog(string.Format("Valore txt:{1}{0}Valore conv:{2}", Environment.NewLine, txtData.Text, valore), tipoLog.INFO);
|
||||
DateTime answ = valore.AddHours(ora).AddMinutes(min);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.4927
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user