This commit is contained in:
2020-07-04 14:41:25 +08:00
parent 70c346d2c1
commit a8f02e4da5
3748 changed files with 587372 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
using UnityEngine;
using System.Collections;
using System;
using Coolape;
using System.Collections.Generic;
[RequireComponent (typeof(UIInput))]
public class CLUIElementDate : UIEventListener
{
public bool isSetTime = false;
public List<EventDelegate> onChange = new List<EventDelegate>();
UIInput _input;
public UIInput input {
get {
if (_input == null) {
_input = GetComponent<UIInput> ();
if (_input != null) {
_input.enabled = false;
}
}
return _input;
}
}
public void OnClick ()
{
if (input != null && !string.IsNullOrEmpty (input.value)) {
DateTime d = DateTime.Parse (input.value);
// DateTime d = DateTime.ParseExact(input.value, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture);
CLUIFormUtl.showCalender (d.Year, d.Month, (Callback)onGetDate, isSetTime);
} else {
CLUIFormUtl.showCalender ((Callback)onGetDate, isSetTime);
}
}
public void onGetDate (params object[] paras)
{
input.value = paras [0].ToString ();
ExecuteOnChange();
}
protected void ExecuteOnChange()
{
if (EventDelegate.IsValid(onChange))
{
EventDelegate.Execute(onChange, gameObject); // modify by chenbin
}
}
}