权声明:本文为博主原创文章,未经博主允许不得转载。

  1. // 为textBox1添加一个日期时间选择控件
  2. DateTimeChoser.AddTo(textBox1);

DateTimeChoser.Designer.cs

  1. using System;
  2. using System.ComponentModel;
  3. using System.Drawing;
  4. using System.Reflection;
  5. using System.Windows.Forms;
  6. namespace pictureAnalyse
  7. {
  8. /// <summary>
  9. /// 此类用于实现一个日期时间辅助输入插件,调用逻辑:
  10. /// new DateTimeChoser(textBox1);  //即可为textBox1绑定一个日期时间输入控件
  11. /// </summary>
  12. public partial class DateTimeChoser : UserControl
  13. {
  14. public static bool showConfirmButton = true;   // 日期时间选择时,是否显示确定按钮
  15. /// <summary>
  16. /// 为textBoox添加一个日期时间选择控件,辅助日期时间的输入
  17. /// </summary>
  18. public static void AddTo(TextBox textBox)
  19. {
  20. try
  21. {
  22. DateTime time = DateTime.Parse(textBox.Text);
  23. }
  24. catch (Exception ex)
  25. {
  26. textBox.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  27. }
  28. textBox.MouseClick += textBoox_MouseClick;
  29. }
  30. /// <summary>
  31. /// 为textBoox添加一个日期时间选择控件,辅助日期时间的输入,并设置初始时显示的时间
  32. /// </summary>
  33. public static void AddTo(TextBox textBoox, DateTime dateTime)
  34. {
  35. textBoox.Text = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
  36. textBoox.MouseClick += textBoox_MouseClick;
  37. }
  38. private static void textBoox_MouseClick(object sender, MouseEventArgs e)
  39. {
  40. TextBox textBox = sender as TextBox;
  41. // 创建一个关联到textBox的日期时间选择控件
  42. DateTimeChoser choser = new DateTimeChoser();
  43. choser.showOn(textBox);
  44. // 设置显示的时间为文本框中的日期时间
  45. try
  46. {
  47. DateTime time = DateTime.Parse(textBox.Text);
  48. choser.setDateTime(time);
  49. }
  50. catch (Exception ex) { }
  51. }
  52. public DateTimeChoser()
  53. {
  54. InitializeComponent();
  55. init();
  56. }
  57. private void init()
  58. {
  59. // 时分秒设置
  60. for (int i = 0; i < 24; i++) comboBox_hour.Items.Add((i < 10 ? "0" : "") + i);
  61. for (int i = 0; i < 60; i = i + 1) comboBox_minite.Items.Add((i < 10 ? "0" : "") + i);
  62. for (int i = 0; i < 60; i++) comboBox_second.Items.Add((i < 10 ? "0" : "") + i);
  63. comboBox_hour.DropDownStyle = ComboBoxStyle.DropDownList;
  64. comboBox_minite.DropDownStyle = ComboBoxStyle.DropDownList;
  65. comboBox_second.DropDownStyle = ComboBoxStyle.DropDownList;
  66. //设置显示的日期时间
  67. setDateTime(DateTime.Now);
  68. }
  69. public delegate void DateTimeChanged_Handle(object sender, EventArgs e);
  70. [Description("当选择日期或时间变动时,调用此事件"), Category("自定义事件")]
  71. public event DateTimeChanged_Handle DateTimeChanged;
  72. // 选择日期变动
  73. private void monthCalendar1_DateSelected(object sender, DateRangeEventArgs e)
  74. {
  75. DateTime S = monthCalendar1.SelectionStart;
  76. string date = S.ToString("yyyy-MM-dd");
  77. if (!date.Equals(label_date.Text))
  78. {
  79. label_date.Text = date;
  80. if (DateTimeChanged != null) DateTimeChanged(this, new EventArgs());
  81. }
  82. }
  83. //选择的时间变动
  84. private void TimeChanged(object sender, EventArgs e)
  85. {
  86. string time = comboBox_hour.Text + ":" + comboBox_minite.Text + ":" + comboBox_second.Text;
  87. if (!time.Equals(label_time.Text))
  88. {
  89. label_time.Text = time;
  90. if (DateTimeChanged != null) DateTimeChanged(this, new EventArgs());
  91. }
  92. }
  93. // 设置显示到指定的日期时间
  94. public void setDateTime(DateTime now)
  95. {
  96. // 初始时界面显示当前的日期时间
  97. label_date.Text = now.ToString("yyyy-MM-dd");
  98. monthCalendar1.SetDate(now);
  99. // 设置时间
  100. label_time.Text = now.ToString("HH:mm:ss");
  101. comboBox_hour.SelectedIndex = now.Hour;
  102. comboBox_minite.SelectedIndex = now.Minute;
  103. comboBox_second.SelectedIndex = now.Second;
  104. }
  105. // 获取当前选择的日期时间
  106. public string getDateTime()
  107. {
  108. return label_date.Text + " " + label_time.Text;
  109. }
  110. # region 自定义控件输入绑定逻辑,将当前日期时间控件绑定到指定的TextBox
  111. private Form form;
  112. TextBox textbox;
  113. private Delegate[] textboxEvents;
  114. // 在指定的TextBox中,显示当前日期时间选择控件,进行日期时间的输入
  115. public void showOn(TextBox textBox, int offX = 0, int offY = 0)
  116. {
  117. Point P = getLocation(textBox);
  118. P = new Point(P.X, P.Y + textBox.Height);
  119. show(textBox, P.X + offX, P.Y + offY, showConfirmButton);
  120. }
  121. // 在TextBox点击时,调用DateTimeChoser进行日期时间的选择,当再次点击时,关闭之前的日期选择状态
  122. private void show(TextBox textbox, int L, int T, bool showButton)
  123. {
  124. this.textbox = textbox;
  125. textboxEvents = getEvents(textbox, "MouseClick");  // 获取TextBox原有事件处理逻辑
  126. ClearEvent(textbox, "MouseClick");          // 移除TextBox原有MouseClick事件处理逻辑
  127. // 新建一个窗体
  128. form = new Form();
  129. form.Width = this.Width;
  130. form.Height = this.Height;
  131. if (showButton) form.Height = this.Height + 40;
  132. form.FormBorderStyle = FormBorderStyle.None;    // 无边框
  133. form.ShowInTaskbar = false;                     // 不在任务栏中显示
  134. form.BackColor = Color.White;                   //
  135. form.Location = new Point(L, T);
  136. // 将当前日期时间选择控件添加到form中
  137. this.Left = 0; this.Top = 0;
  138. form.Controls.Add(this);
  139. if (showButton)
  140. {
  141. Button button = new Button();
  142. button.Text = "确定";
  143. button.ForeColor = Color.Blue;
  144. button.Left = (this.Width - button.Width) / 2;
  145. button.Top = this.Height + (40 - button.Height) / 2;
  146. form.Controls.Add(button);
  147. button.Click += button_Click;
  148. }
  149. form.Show();             // 显示日期时间选择
  150. form.Location = new Point(L, T);
  151. form.TopMost = true;
  152. form.Activate();         // 当前界面获取到焦点
  153. Form Parent = getParentForm(textbox);       // 获取TextBox的父窗体
  154. if (Parent != null) Parent.FormClosed += Parent_FormClosed;
  155. textbox.MouseClick += textbox_MouseClick;
  156. }
  157. // 添加
  158. private void button_Click(object sender, EventArgs e)
  159. {
  160. textbox_MouseClick(textbox, null);
  161. }
  162. // 关闭当前form
  163. private void Parent_FormClosed(object sender, FormClosedEventArgs e)
  164. {
  165. if (form != null)
  166. {
  167. form.Close();
  168. form = null;
  169. }
  170. }
  171. private void textbox_MouseClick(object sender, MouseEventArgs e)
  172. {
  173. TextBox textBox = sender as TextBox;
  174. textBox.Text = getDateTime();
  175. if (form != null)
  176. {
  177. form.Close();
  178. form = null;
  179. }
  180. textBox.MouseClick -= textbox_MouseClick;           // 移除当前事件处理逻辑
  181. addEvents(textBox, "MouseClick", textboxEvents);    // 还原TextBox原有事件处理逻辑
  182. }
  183. # endregion
  184. // 获取给定控件的父窗体
  185. public static Form getParentForm(Control control)
  186. {
  187. if (control is Form) return control as Form;
  188. Control C = control;
  189. while (C.Parent != null)
  190. {
  191. if (C.Parent is Form) return C.Parent as Form;
  192. else C = C.Parent;
  193. }
  194. return null;
  195. }
  196. #region 获取控件的坐标信息
  197. /// <summary>
  198. /// 获取任意控件相对于屏幕的坐标
  199. /// </summary>
  200. public static Point getLocation(Control control)
  201. {
  202. Point P;
  203. if (control is Form) P = getFormClientLocation(control as Form);
  204. else P = control.Location;
  205. if (control.Parent != null)
  206. {
  207. Control parent = control.Parent;
  208. Point P2 = getLocation(parent);
  209. P = new Point(P.X + P2.X, P.Y + P2.Y);
  210. }
  211. return P;
  212. }
  213. /// <summary>
  214. /// 获取Form窗体有效显示区域的起点,相对于屏幕的坐标
  215. /// </summary>
  216. public static Point getFormClientLocation(Form form)
  217. {
  218. Rectangle rect = form.ClientRectangle;
  219. int offx = 0, offy = 0;
  220. if (form.FormBorderStyle != FormBorderStyle.None)
  221. {
  222. offx = (form.Width - rect.Width) / 2;
  223. offy = (form.Height - rect.Height) - 8;
  224. }
  225. Point P = new Point(form.Location.X + offx, form.Location.Y + offy);
  226. return P;
  227. }
  228. # endregion
  229. # region 动态修改控件对应的事件处理逻辑
  230. // ClearEvent(button1,"Click");//就会清除button1对象的Click事件的所有挂接事件。
  231. private void ClearEvent(Control control, string eventname)
  232. {
  233. if (control == null) return;
  234. if (string.IsNullOrEmpty(eventname)) return;
  235. BindingFlags mPropertyFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.Static | BindingFlags.NonPublic;
  236. BindingFlags mFieldFlags = BindingFlags.Static | BindingFlags.NonPublic;
  237. Type controlType = typeof(System.Windows.Forms.Control);
  238. PropertyInfo propertyInfo = controlType.GetProperty("Events", mPropertyFlags);
  239. EventHandlerList eventHandlerList = (EventHandlerList)propertyInfo.GetValue(control, null);
  240. FieldInfo fieldInfo = (typeof(Control)).GetField("Event" + eventname, mFieldFlags);
  241. Delegate d = eventHandlerList[fieldInfo.GetValue(control)];
  242. if (d == null) return;
  243. EventInfo eventInfo = controlType.GetEvent(eventname);
  244. foreach (Delegate dx in d.GetInvocationList())
  245. eventInfo.RemoveEventHandler(control, dx);
  246. }
  247. // getEvent(button1,"Click"); //就会获取到button1对象的Click事件的所有挂接事件。
  248. private Delegate[] getEvents(Control control, string eventname)
  249. {
  250. if (control == null) return null;
  251. if (string.IsNullOrEmpty(eventname)) return null;
  252. BindingFlags mPropertyFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.Static | BindingFlags.NonPublic;
  253. BindingFlags mFieldFlags = BindingFlags.Static | BindingFlags.NonPublic;
  254. Type controlType = typeof(System.Windows.Forms.Control);
  255. PropertyInfo propertyInfo = controlType.GetProperty("Events", mPropertyFlags);
  256. EventHandlerList eventHandlerList = (EventHandlerList)propertyInfo.GetValue(control, null);
  257. FieldInfo fieldInfo = (typeof(Control)).GetField("Event" + eventname, mFieldFlags);
  258. Delegate d = eventHandlerList[fieldInfo.GetValue(control)];
  259. if (d == null) return null;
  260. Delegate[] events = new Delegate[d.GetInvocationList().Length];
  261. int i = 0;
  262. foreach (Delegate dx in d.GetInvocationList()) events[i++] = dx;
  263. return events;
  264. }
  265. // addEvents(button1,"Click"); // 为button1对象的Click事件挂接事件
  266. private void addEvents(Control control, string eventname, Delegate[] evenets)
  267. {
  268. if (control == null) return;
  269. if (string.IsNullOrEmpty(eventname)) return;
  270. Type controlType = typeof(System.Windows.Forms.Control);
  271. EventInfo eventInfo = controlType.GetEvent(eventname);
  272. foreach (Delegate e in evenets)
  273. eventInfo.AddEventHandler(control, e);
  274. }
  275. # endregion
  276. }
  277. }

DateTimeChoser.cs

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace pictureAnalyse
  11. {
  12. partial class DateTimeChoser
  13. {
  14. /// <summary>
  15. /// 必需的设计器变量。
  16. /// </summary>
  17. private System.ComponentModel.IContainer components = null;
  18. /// <summary>
  19. /// 清理所有正在使用的资源。
  20. /// </summary>
  21. /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
  22. protected override void Dispose(bool disposing)
  23. {
  24. if (disposing && (components != null))
  25. {
  26. components.Dispose();
  27. }
  28. base.Dispose(disposing);
  29. }
  30. #region 组件设计器生成的代码
  31. /// <summary>
  32. /// 设计器支持所需的方法 - 不要
  33. /// 使用代码编辑器修改此方法的内容。
  34. /// </summary>
  35. private void InitializeComponent()
  36. {
  37. this.monthCalendar1 = new System.Windows.Forms.MonthCalendar();
  38. this.panel_consume = new System.Windows.Forms.Panel();
  39. this.label6 = new System.Windows.Forms.Label();
  40. this.comboBox_second = new System.Windows.Forms.ComboBox();
  41. this.label5 = new System.Windows.Forms.Label();
  42. this.comboBox_minite = new System.Windows.Forms.ComboBox();
  43. this.label4 = new System.Windows.Forms.Label();
  44. this.comboBox_hour = new System.Windows.Forms.ComboBox();
  45. this.panel1 = new System.Windows.Forms.Panel();
  46. this.label_date = new System.Windows.Forms.Label();
  47. this.label_time = new System.Windows.Forms.Label();
  48. this.panel2 = new System.Windows.Forms.Panel();
  49. this.panel_consume.SuspendLayout();
  50. this.panel1.SuspendLayout();
  51. this.panel2.SuspendLayout();
  52. this.SuspendLayout();
  53. //
  54. // monthCalendar1
  55. //
  56. this.monthCalendar1.AllowDrop = true;
  57. this.monthCalendar1.Location = new System.Drawing.Point(-3, 15);
  58. this.monthCalendar1.Name = "monthCalendar1";
  59. this.monthCalendar1.TabIndex = 0;
  60. this.monthCalendar1.DateSelected += new System.Windows.Forms.DateRangeEventHandler(this.monthCalendar1_DateSelected);
  61. //
  62. // panel_consume
  63. //
  64. this.panel_consume.BackColor = System.Drawing.Color.White;
  65. this.panel_consume.Controls.Add(this.label6);
  66. this.panel_consume.Controls.Add(this.comboBox_second);
  67. this.panel_consume.Controls.Add(this.label5);
  68. this.panel_consume.Controls.Add(this.comboBox_minite);
  69. this.panel_consume.Controls.Add(this.label4);
  70. this.panel_consume.Controls.Add(this.comboBox_hour);
  71. this.panel_consume.Location = new System.Drawing.Point(-2, 173);
  72. this.panel_consume.Name = "panel_consume";
  73. this.panel_consume.Size = new System.Drawing.Size(222, 30);
  74. this.panel_consume.TabIndex = 23;
  75. //
  76. // label6
  77. //
  78. this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  79. this.label6.AutoSize = true;
  80. this.label6.Location = new System.Drawing.Point(195, 10);
  81. this.label6.Name = "label6";
  82. this.label6.Size = new System.Drawing.Size(17, 12);
  83. this.label6.TabIndex = 15;
  84. this.label6.Text = "秒";
  85. //
  86. // comboBox_second
  87. //
  88. this.comboBox_second.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  89. this.comboBox_second.FormattingEnabled = true;
  90. this.comboBox_second.Location = new System.Drawing.Point(149, 6);
  91. this.comboBox_second.Name = "comboBox_second";
  92. this.comboBox_second.Size = new System.Drawing.Size(40, 20);
  93. this.comboBox_second.TabIndex = 14;
  94. this.comboBox_second.Text = "0";
  95. this.comboBox_second.SelectedIndexChanged += new System.EventHandler(this.TimeChanged);
  96. //
  97. // label5
  98. //
  99. this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  100. this.label5.AutoSize = true;
  101. this.label5.Location = new System.Drawing.Point(126, 10);
  102. this.label5.Name = "label5";
  103. this.label5.Size = new System.Drawing.Size(17, 12);
  104. this.label5.TabIndex = 13;
  105. this.label5.Text = "分";
  106. //
  107. // comboBox_minite
  108. //
  109. this.comboBox_minite.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  110. this.comboBox_minite.FormattingEnabled = true;
  111. this.comboBox_minite.Location = new System.Drawing.Point(80, 6);
  112. this.comboBox_minite.Name = "comboBox_minite";
  113. this.comboBox_minite.Size = new System.Drawing.Size(40, 20);
  114. this.comboBox_minite.TabIndex = 12;
  115. this.comboBox_minite.Text = "0";
  116. this.comboBox_minite.SelectedIndexChanged += new System.EventHandler(this.TimeChanged);
  117. //
  118. // label4
  119. //
  120. this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  121. this.label4.AutoSize = true;
  122. this.label4.Location = new System.Drawing.Point(57, 10);
  123. this.label4.Name = "label4";
  124. this.label4.Size = new System.Drawing.Size(17, 12);
  125. this.label4.TabIndex = 11;
  126. this.label4.Text = "时";
  127. //
  128. // comboBox_hour
  129. //
  130. this.comboBox_hour.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  131. this.comboBox_hour.FormattingEnabled = true;
  132. this.comboBox_hour.Location = new System.Drawing.Point(9, 6);
  133. this.comboBox_hour.Name = "comboBox_hour";
  134. this.comboBox_hour.Size = new System.Drawing.Size(42, 20);
  135. this.comboBox_hour.TabIndex = 10;
  136. this.comboBox_hour.Text = "0";
  137. this.comboBox_hour.SelectedIndexChanged += new System.EventHandler(this.TimeChanged);
  138. //
  139. // panel1
  140. //
  141. this.panel1.BackColor = System.Drawing.Color.White;
  142. this.panel1.Controls.Add(this.label_date);
  143. this.panel1.Controls.Add(this.label_time);
  144. this.panel1.Location = new System.Drawing.Point(-3, -1);
  145. this.panel1.Name = "panel1";
  146. this.panel1.Size = new System.Drawing.Size(223, 23);
  147. this.panel1.TabIndex = 25;
  148. //
  149. // label_date
  150. //
  151. this.label_date.AutoSize = true;
  152. this.label_date.BackColor = System.Drawing.Color.White;
  153. this.label_date.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  154. this.label_date.Location = new System.Drawing.Point(18, 3);
  155. this.label_date.Name = "label_date";
  156. this.label_date.Size = new System.Drawing.Size(98, 16);
  157. this.label_date.TabIndex = 26;
  158. this.label_date.Text = "2016-06-12";
  159. //
  160. // label_time
  161. //
  162. this.label_time.AutoSize = true;
  163. this.label_time.BackColor = System.Drawing.Color.White;
  164. this.label_time.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  165. this.label_time.Location = new System.Drawing.Point(118, 3);
  166. this.label_time.Name = "label_time";
  167. this.label_time.Size = new System.Drawing.Size(80, 16);
  168. this.label_time.TabIndex = 25;
  169. this.label_time.Text = "12:23:35";
  170. //
  171. // panel2
  172. //
  173. this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  174. this.panel2.Controls.Add(this.panel1);
  175. this.panel2.Controls.Add(this.panel_consume);
  176. this.panel2.Controls.Add(this.monthCalendar1);
  177. this.panel2.Location = new System.Drawing.Point(0, 0);
  178. this.panel2.Name = "panel2";
  179. this.panel2.Size = new System.Drawing.Size(215, 202);
  180. this.panel2.TabIndex = 26;
  181. //
  182. // DateTimeChoser
  183. //
  184. this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
  185. this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  186. this.Controls.Add(this.panel2);
  187. this.Name = "DateTimeChoser";
  188. this.Size = new System.Drawing.Size(215, 202);
  189. this.panel_consume.ResumeLayout(false);
  190. this.panel_consume.PerformLayout();
  191. this.panel1.ResumeLayout(false);
  192. this.panel1.PerformLayout();
  193. this.panel2.ResumeLayout(false);
  194. this.ResumeLayout(false);
  195. }
  196. #endregion
  197. private System.Windows.Forms.MonthCalendar monthCalendar1;
  198. private System.Windows.Forms.Panel panel_consume;
  199. private System.Windows.Forms.Label label6;
  200. private System.Windows.Forms.ComboBox comboBox_second;
  201. private System.Windows.Forms.Label label5;
  202. private System.Windows.Forms.ComboBox comboBox_minite;
  203. private System.Windows.Forms.Label label4;
  204. private System.Windows.Forms.ComboBox comboBox_hour;
  205. private System.Windows.Forms.Panel panel1;
  206. private System.Windows.Forms.Label label_date;
  207. private System.Windows.Forms.Label label_time;
  208. private System.Windows.Forms.Panel panel2;
  209. }
  210. }

添加以上两个类到项目,编译运行一次。自定义的DateTimeChoser控件会出现在工具箱中。

可直接拖拽至Form窗体中使用,也可通过代码进行调用。

示例下载 pictureAnalyse.exe

示例源码下载 pictureAnalyse.zip

C# 自定义控件,日期时间选择输入插件的更多相关文章

  1. Java+Selenium操作日期时间选择框插件

    在自动化测试的时候我们经常会碰到下面的时间日期插件(这个时候这个文本框是不运行我们输入时间的), 我们可以用java获取当前日期,然后用Selenium结合JS代码就可以直接往文本框输入内容. 像这种 ...

  2. jquery插件课程1 幻灯片、城市选择、日期时间选择、拖放、方向拖动插件

    jquery插件课程1  幻灯片.城市选择.日期时间选择.拖放.方向拖动插件 一.总结 一句话总结:都是jquery插件,都还比较小,参数(配置参数.数据)一般都是通过json传递. 1.插件配置数据 ...

  3. Jquery mobiscroll 移动设备(手机)wap日期时间选择插件以及滑动、滚动插件

    Jquery Mobiscroll是一个用于触摸设备(Android phones, iPhone, iPad, Galaxy Tab)的日期和时间选择器jQuery插件.以及各种滑动插件 可以让用户 ...

  4. 24款最好的jQuery日期时间选择器插件

    如果你正在创建一个网络表单,有很多事情你需要在你的应用程序中使用.有时您需要特别的输入,从用户的日期和时间,如发票日期,生日,交货时间,或任何其他此类信息.如果你有这样的需要,可以极大地从动态的jQu ...

  5. flatpickr功能强大的日期时间选择器插件

    flatpickr日期时间选择器支持移动手机,提供多种内置的主题效果,并且提供对中文的支持.它的特点还有: 使用SVG作为界面的图标. 兼容jQuery. 支持对各种日期格式的解析. 轻量级,高性能, ...

  6. 日期时间范围选择插件:daterangepicker使用总结

    分享说明: 项目中要使用日期时间范围选择对数据进行筛选;精确到年月日 时分秒;起初,使用了layui的时间日期选择插件;但是在IIE8第一次点击会报设置格式错误;研究了很久没解决,但能确定不是layu ...

  7. 日期时间选择器插件flatpickr

    前言:在网页上需要输入时间的时候,我们可以用HTML5的inputl中的date类型.但是如下入所示,有些浏览器不支持.flatpickr这个小插件可以解决这个问题. 1.flatpickr日期时间选 ...

  8. 15. Fluentd输入插件:in_tail用法详解

    in_tail输入插件内置于Fluentd中,无需安装. 它允许fluentd从文本文件尾部读取日志事件,其行为类似linux的tail -F命令(按文件名来tail). 这几乎是最常用的一个输入插件 ...

  9. 9月23日JavaScript作业----日期时间选择

    作业二:日期时间选择 <div style="width:600px; height:100px;"> <select id="year"&g ...

随机推荐

  1. Get file extention in XSLT

      When working with data view web parts or data form web parts in SharePoint, you might want to use ...

  2. javascript 关键字不能作为变量来使用

    var cfg={export: "export.aspx"} 这句代码中使用了一个关键字“export” 所以在IE8中报错. 那么有哪些关键字不能作为变量呢? 关键字”就是 J ...

  3. eclipse启动错误:java.lang.NoClassDefFoundError: org/eclipse/core/resources/IContainer

    转自:http://blog.csdn.net/niu_hao/article/details/9332521 eclipse启动时报错如下:java.lang.NoClassDefFoundErro ...

  4. PHP http_build_query()方法

    http_build_query (PHP 5) http_build_query -- 生成 url-encoded 之后的请求字符串描述 string http_build_query ( arr ...

  5. 微信小程序 - loading(组件)

    更新日期: 2019/3/8:首次发布 2019/3/12:增加loadOpacity透明度控制,默认0.5. 以及修改居中方式 Loading 参数: 1. type:loading(必需参数) 2 ...

  6. openfiler在esxi下的安装配置

    注意分区的时候如果硬盘太小自动分区会导致分配的卷大小不够用 后改为如下: 以root登录: 应该以openfiler登录,口令是password 也可以导入虚拟机安装 升级虚拟机硬件版本 终端登录用户 ...

  7. Spring Jdbc事例说明(三)

    上一篇文章已经讲解了如何使用Spring搭建工程,这一篇文章是接着上一篇文章来描述的. 一.载入依赖 新增加了两个依赖,mysql数据库驱动和alibaba数据源包 <!-- mysql驱动包 ...

  8. Unity3D调用android方法(非插件方式)

    关于Unity3Dproject与androidproject的转换与合并,请參考我的另外一篇博客.假设你对Unity3Dproject增加到androidproject的过程不熟悉.也请先看完以下这 ...

  9. MySQL源代码解读

    第一步: 下载bison-2.4.1-setup.exe链接地址 第二步: 下载cmake-2.8.6-win32-x86.exe链接地址 第三步: 下载MySQL链接地址 G:\Mlearn\mys ...

  10. web前端开发,如何提高页面性能优化?

    内容方面: 1.减少 HTTP 请求 (Make Fewer HTTP Requests) 2.减少 DOM 元素数量 (Reduce the Number of DOM Elements) 3.使得 ...