Sep 27, 2017, 12:17 PM
DateField Enable Only 3rd Date of Every Month and Disable the others.
Hi,
I have some problem on customizing selectable dates in DateField.
Here is my current code.
But now I want to enable only 3rd DATE of every month so the other date 1, 2, 4, 5, ..., 31 are disabled (3 is only example, the real application can be any date 1-31).
It will be tricky on some date like 31st (because not every month have 31st date). Maybe in some month like february, 28th is enabled when 30th is enabled on another month.
How can I do this?
Sorry for my bad english.
I have some problem on customizing selectable dates in DateField.
Here is my current code.
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
dfMain.DisabledDays = new int[] { 0, 1, 2, 4, 5, 6 };
dfMain.UpdateDisabledDays();
}
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET Examples</title>
<script type="text/javascript">
</script>
</head>
<body>
<ext:ResourceManager runat="server" />
<ext:DateField
ID="dfMain"
runat="server"
AutoDataBind="true"
MinDate="<%# DateTime.Now %>"
Vtype="daterange"
FieldLabel="Select Date" />
</body>
</html>
With this code, I can enable only third DAY (wednesday) in the datefield.But now I want to enable only 3rd DATE of every month so the other date 1, 2, 4, 5, ..., 31 are disabled (3 is only example, the real application can be any date 1-31).
It will be tricky on some date like 31st (because not every month have 31st date). Maybe in some month like february, 28th is enabled when 30th is enabled on another month.
How can I do this?
Sorry for my bad english.
Last edited by Kuro13; Sep 27, 2017 at 1:19 PM.