diff --git a/src/AnnouncementsEdit.ascx b/src/AnnouncementsEdit.ascx
index df6e46e..423d505 100644
--- a/src/AnnouncementsEdit.ascx
+++ b/src/AnnouncementsEdit.ascx
@@ -1,6 +1,4 @@
-<%@ Control Language="C#" AutoEventWireup="false" CodeBehind="AnnouncementsEdit.ascx.cs"
- Inherits="DotNetNuke.Modules.Announcements.AnnouncementsEdit" %>
-<%@ Register Assembly="DotNetNuke" Namespace="DotNetNuke.UI.UserControls" TagPrefix="dnn" %>
+<%@ Control Language="C#" AutoEventWireup="false" CodeBehind="AnnouncementsEdit.ascx.cs" Inherits="DotNetNuke.Modules.Announcements.AnnouncementsEdit" %>
<%@ Register TagPrefix="dnn" TagName="TextEditor" Src="~/controls/TextEditor.ascx" %>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
<%@ Register TagPrefix="dnn" TagName="Tracking" Src="~/controls/URLTrackingControl.ascx" %>
@@ -8,8 +6,6 @@
<%@ Register TagPrefix="dnn" TagName="URL" Src="~/controls/URLControl.ascx" %>
<%@ Register TagPrefix="dnn" TagName="FilePickerUploader" Src="~/controls/filepickeruploader.ascx" %>
<%@ Import Namespace="DotNetNuke.Services.Localization" %>
-<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.UI.WebControls" Assembly="DotNetNuke" %>
-<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.UI.WebControls.Internal" Assembly="DotNetNuke.Web" %>
diff --git a/src/AnnouncementsEdit.ascx.cs b/src/AnnouncementsEdit.ascx.cs
index 48aea60..4b38064 100644
--- a/src/AnnouncementsEdit.ascx.cs
+++ b/src/AnnouncementsEdit.ascx.cs
@@ -27,12 +27,10 @@
using System;
using System.Data.SqlTypes;
using System.Globalization;
-
+using System.Web.UI.WebControls;
using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
-using DotNetNuke.Entities.Portals;
using DotNetNuke.Entities.Users;
-using DotNetNuke.Framework;
using DotNetNuke.Framework.JavaScriptLibraries;
using DotNetNuke.Modules.Announcements.Components.Business;
using DotNetNuke.Modules.Announcements.Components.Common;
@@ -40,11 +38,9 @@
using DotNetNuke.Modules.Announcements.MVP.Presenters;
using DotNetNuke.Modules.Announcements.MVP.Views;
using DotNetNuke.Services.Exceptions;
-using DotNetNuke.Services.Localization;
using DotNetNuke.Web.Client;
using DotNetNuke.Web.Client.ClientResourceManagement;
using DotNetNuke.Web.Mvp;
-using DotNetNuke.Web.UI.WebControls.Internal;
using WebFormsMvp;
#endregion
@@ -206,13 +202,13 @@ private void BindForm()
(Model.AnnouncementInfo.PublishDate != (DateTime)SqlDateTime.Null))
{
var portalDateTime = TimeZoneInfo.ConvertTimeFromUtc(Model.AnnouncementInfo.PublishDate.Value, ModuleContext.PortalSettings.TimeZone);
- publishDate.SelectedDate = portalDateTime;
+ publishDate.Text = portalDateTime.ToString("yyyy-MM-dd'T'HH:mm", CultureInfo.InvariantCulture);
}
if ((!Null.IsNull(Model.AnnouncementInfo.ExpireDate)) &&
(Model.AnnouncementInfo.ExpireDate != (DateTime)SqlDateTime.Null))
{
var portalDateTime = TimeZoneInfo.ConvertTimeFromUtc(Model.AnnouncementInfo.ExpireDate.Value, ModuleContext.PortalSettings.TimeZone);
- expireDate.SelectedDate = portalDateTime;
+ expireDate.Text = portalDateTime.ToString("yyyy-MM-dd'T'HH:mm", CultureInfo.InvariantCulture);
}
var user = UserController.Instance.GetCurrentUserInfo();
@@ -280,13 +276,13 @@ private string ReturnURL
}
}
- private DateTime? GetDateTimeValue(DnnDatePicker dnnDatePicker)
+ private DateTime? GetDateTimeValue(TextBox datePicker)
{
DateTime? resultValue = null;
- if (dnnDatePicker.SelectedDate != null)
+ if (DateTime.TryParseExact(datePicker.Text, ["yyyy-MM-dd'T'HH:mm", "yyyy-MM-dd"], CultureInfo.InvariantCulture, DateTimeStyles.None, out var selectedDate))
{
- resultValue = dnnDatePicker.SelectedDate;
+ resultValue = selectedDate;
}
if (resultValue.HasValue)
@@ -297,19 +293,11 @@ private string ReturnURL
return null;
}
- private DateTime? GetDateTimeValue(DnnDateTimePicker dnnDatePicker, DateTime defaultValue)
+ private DateTime? GetDateTimeValue(TextBox datePicker, DateTime defaultValue)
{
- DateTime? resultValue = GetDateTimeValue(dnnDatePicker);
-
- if (!resultValue.HasValue)
- {
- resultValue = defaultValue;
- }
-
- return resultValue;
+ return GetDateTimeValue(datePicker) ?? defaultValue;
}
-
}
}
diff --git a/src/AnnouncementsEdit.ascx.designer.cs b/src/AnnouncementsEdit.ascx.designer.cs
index 67b2b2c..850adcd 100644
--- a/src/AnnouncementsEdit.ascx.designer.cs
+++ b/src/AnnouncementsEdit.ascx.designer.cs
@@ -1,188 +1,188 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace DotNetNuke.Modules.Announcements
-{
-
-
- public partial class AnnouncementsEdit
- {
-
- ///
- /// contentTab control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.HtmlControls.HtmlGenericControl contentTab;
-
- ///
- /// imageLinksTab control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.HtmlControls.HtmlGenericControl imageLinksTab;
-
- ///
- /// publishingTab control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.HtmlControls.HtmlGenericControl publishingTab;
-
- ///
- /// auditingTab control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.HtmlControls.HtmlGenericControl auditingTab;
-
- ///
- /// txtTitle control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.TextBox txtTitle;
-
- ///
- /// valTitle control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.RequiredFieldValidator valTitle;
-
- ///
- /// valDescription control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.RequiredFieldValidator valDescription;
-
- ///
- /// plImage control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.UserControl plImage;
-
- ///
- /// plURL control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.UserControl plURL;
-
- ///
- /// plViewOrder control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.UserControl plViewOrder;
-
- ///
- /// txtViewOrder control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.TextBox txtViewOrder;
-
- ///
- /// valViewOrder control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.CompareValidator valViewOrder;
-
- ///
- /// plPublishDate control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.UserControl plPublishDate;
-
- ///
- /// publishDate control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::DotNetNuke.Web.UI.WebControls.Internal.DnnDateTimePicker publishDate;
-
- ///
- /// plExpireDate control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.UserControl plExpireDate;
-
- ///
- /// expireDate control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::DotNetNuke.Web.UI.WebControls.Internal.DnnDateTimePicker expireDate;
-
- ///
- /// cmdUpdate control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.LinkButton cmdUpdate;
-
- ///
- /// cmdDelete control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.LinkButton cmdDelete;
-
- ///
- /// cancelHyperLink control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.HyperLink cancelHyperLink;
- }
-}
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace DotNetNuke.Modules.Announcements
+{
+
+
+ public partial class AnnouncementsEdit
+ {
+
+ ///
+ /// contentTab control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl contentTab;
+
+ ///
+ /// imageLinksTab control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl imageLinksTab;
+
+ ///
+ /// publishingTab control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl publishingTab;
+
+ ///
+ /// auditingTab control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl auditingTab;
+
+ ///
+ /// txtTitle control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtTitle;
+
+ ///
+ /// valTitle control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.RequiredFieldValidator valTitle;
+
+ ///
+ /// valDescription control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.RequiredFieldValidator valDescription;
+
+ ///
+ /// plImage control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.UserControl plImage;
+
+ ///
+ /// plURL control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.UserControl plURL;
+
+ ///
+ /// plViewOrder control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.UserControl plViewOrder;
+
+ ///
+ /// txtViewOrder control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtViewOrder;
+
+ ///
+ /// valViewOrder control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.CompareValidator valViewOrder;
+
+ ///
+ /// plPublishDate control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.UserControl plPublishDate;
+
+ ///
+ /// publishDate control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox publishDate;
+
+ ///
+ /// plExpireDate control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.UserControl plExpireDate;
+
+ ///
+ /// expireDate control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox expireDate;
+
+ ///
+ /// cmdUpdate control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.LinkButton cmdUpdate;
+
+ ///
+ /// cmdDelete control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.LinkButton cmdDelete;
+
+ ///
+ /// cancelHyperLink control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.HyperLink cancelHyperLink;
+ }
+}
diff --git a/src/AnnouncementsEdit.css b/src/AnnouncementsEdit.css
index 44df998..33d9292 100644
--- a/src/AnnouncementsEdit.css
+++ b/src/AnnouncementsEdit.css
@@ -2,7 +2,7 @@
width: 420px;
}
-.dateDiv { display: inline-block;width: 150px; margin-bottom: 20px;}
+.dateDiv { display: inline-block; margin-bottom: 20px;}
.dnnFormItem .dateDiv input { width: 100%; }
diff --git a/src/DotNetNuke.Announcements.csproj b/src/DotNetNuke.Announcements.csproj
index 0100312..004f150 100644
--- a/src/DotNetNuke.Announcements.csproj
+++ b/src/DotNetNuke.Announcements.csproj
@@ -3,6 +3,7 @@
.vs
+ latest