Apr 17, 2020, 1:07 PM
[OPEN] [#1765] Problem send date directmethod
Hi,
I am migrating to version 5.2, and I realized that the dates sent via direchtmethod are converted to utc.
My browser timezone is +2.
See my example, if I open the page on 17-04-2020, the datefield show 17-04-2020 but on the server I receive 16-04-2020 22:00:00.
In version 4 I was given the date shown.
Thank you
I am migrating to version 5.2, and I realized that the dates sent via direchtmethod are converted to utc.
My browser timezone is +2.
See my example, if I open the page on 17-04-2020, the datefield show 17-04-2020 but on the server I receive 16-04-2020 22:00:00.
In version 4 I was given the date shown.
Thank you
<%@ Page Language="C#" %>
<script runat="server">
[DirectMethod]
public void ShowDate(DateTime dt)
{
X.Msg.Show(new MessageBoxConfig
{
Title = "Title",
Message = dt.ToString(),
Buttons = MessageBox.Button.OK,
Icon = MessageBox.Icon.ERROR
});
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack && !X.IsAjaxRequest)
{
var date = DateTime.Now;
DateField1.SelectedDate = DateTime.Now;
}
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title></title>
<script type="text/javascript">
var btnClick = function () {
App.direct.ShowDate(App.DateField1.getValue());
}
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:DateField
ID="DateField1"
runat="server"
FieldLabel="Date">
<CustomConfig>
<ext:ConfigItem Name="endDateField" Value="DateField2" Mode="Value" />
</CustomConfig>
</ext:DateField>
<ext:Button ID="btn" runat="server" Text="Send">
<Listeners>
<Click Handler="btnClick();" />
</Listeners>
</ext:Button>
</form>
</body>
</html>
Last edited by fabricio.murta; Nov 12, 2020 at 10:01 PM.
Reason: closed by mistake, checked wrong issue (1605).