dever há 5 anos atrás
pai
commit
10c57a56fe
1 ficheiros alterados com 33 adições e 3 exclusões
  1. 33 3
      src/Lib/Input.php

+ 33 - 3
src/Lib/Input.php

@@ -1109,17 +1109,17 @@ class Input
     }
 
     /**
-     * time
+     * time已废弃,用day替换
      *
      * @return string
      */
     public static function _time($param)
     {
-        return '<input type="text" value="' . ((isset($param['value']) && $param['value'] > 0) ? date('Y-m-d', $param['value']) : ((isset($param['default']) && $param['default'] > 0) ? date('Y-m-d', $param['default']) : '')) . '" placeholder="' . (isset($param['lang']) ? $param['lang'] : '') . '" name="' . $param['name'] . '" class="manage_time update_value form-control ' . (isset($param['valid']) ? $param['valid'] : '') . '" autocomplete="off"/>';
+        return $this->_date($param);
     }
 
     /**
-     * date
+     * 选择详细的时间
      *
      * @return string
      */
@@ -1128,6 +1128,36 @@ class Input
         return '<input type="text" value="' . ((isset($param['value']) && $param['value'] > 0) ? date('Y-m-d H:i:s', $param['value']) : ((isset($param['default']) && $param['default'] > 0) ? date('Y-m-d H:i:s', $param['default']) : '')) . '" placeholder="' . (isset($param['lang']) ? $param['lang'] : '') . '" name="' . $param['name'] . '" class="manage_date update_value form-control ' . (isset($param['valid']) ? $param['valid'] : '') . '" autocomplete="off"/>';
     }
 
+    /**
+     * day 选择天
+     *
+     * @return string
+     */
+    public static function _day($param)
+    {
+        return '<input type="text" value="' . ((isset($param['value']) && $param['value'] > 0) ? date('Y-m-d', $param['value']) : ((isset($param['default']) && $param['default'] > 0) ? date('Y-m-d', $param['default']) : '')) . '" placeholder="' . (isset($param['lang']) ? $param['lang'] : '') . '" name="' . $param['name'] . '" class="manage_day update_value form-control ' . (isset($param['valid']) ? $param['valid'] : '') . '" autocomplete="off"/>';
+    }
+
+    /**
+     * 选择年
+     *
+     * @return string
+     */
+    public static function _year($param)
+    {
+        return '<input type="text" value="' . ((isset($param['value']) && $param['value'] > 0) ? date('Y-m-d H:i:s', $param['value']) : ((isset($param['default']) && $param['default'] > 0) ? date('Y-m-d H:i:s', $param['default']) : '')) . '" placeholder="' . (isset($param['lang']) ? $param['lang'] : '') . '" name="' . $param['name'] . '" class="manage_year update_value form-control ' . (isset($param['valid']) ? $param['valid'] : '') . '" autocomplete="off"/>';
+    }
+
+    /**
+     * 选择月
+     *
+     * @return string
+     */
+    public static function _month($param)
+    {
+        return '<input type="text" value="' . ((isset($param['value']) && $param['value'] > 0) ? date('Y-m-d H:i:s', $param['value']) : ((isset($param['default']) && $param['default'] > 0) ? date('Y-m-d H:i:s', $param['default']) : '')) . '" placeholder="' . (isset($param['lang']) ? $param['lang'] : '') . '" name="' . $param['name'] . '" class="manage_month update_value form-control ' . (isset($param['valid']) ? $param['valid'] : '') . '" autocomplete="off"/>';
+    }
+
     /**
      * div
      *