Example #1
0
 /// <summary>
 /// 获取日期选择器
 /// </summary>
 /// <param name="type">类型</param>
 /// <returns>日期选择器</returns>
 DateTimePicker getPicker(DateTimePicker.Type type)
 {
     foreach (var picker in pickers)
     {
         if (picker.type == type)
         {
             return(picker);
         }
     }
     return(null);
 }
Example #2
0
        /// <summary>
        /// 更新值
        /// </summary>
        public void updateValue(int delta, DateTimePicker.Type type)
        {
            Debug.Log(type + " updateValue: " + delta);
            switch (type)
            {
            case DateTimePicker.Type.Year:
                setValue(value.AddYears(delta), false, false); break;

            case DateTimePicker.Type.Month:
                setValue(value.AddMonths(delta), false, false); break;

            case DateTimePicker.Type.Day:
                setValue(value.AddDays(delta), false, false); break;

            case DateTimePicker.Type.Hour:
                setValue(value.AddHours(delta), false, false); break;

            case DateTimePicker.Type.Minute:
                setValue(value.AddMinutes(delta), false, false); break;

            case DateTimePicker.Type.Second:
                setValue(value.AddSeconds(delta), false, false); break;
            }
        }