| | |
| | | } |
| | | |
| | | /** |
| | | * MM |
| | | */ |
| | | fun getMonthStr(date: Date?): String { |
| | | try { |
| | | return getDateStr(date).substring(5, 7) |
| | | } catch (e: Exception) { |
| | | e.printStackTrace() |
| | | } |
| | | return "" |
| | | } |
| | | |
| | | /** |
| | | * dd |
| | | */ |
| | | fun getDayStr(date: Date?): String { |
| | |
| | | return weekDays[index] |
| | | } |
| | | |
| | | fun parseYearMonth(str: String): Date { |
| | | try { |
| | | return SimpleDateFormat("yyyy-MM", Locale.getDefault()).parse(str) |
| | | fun parseYearMonth(str: String?): Date? { |
| | | return try { |
| | | SimpleDateFormat("yyyy-MM", Locale.getDefault()).parse(str) |
| | | } catch (e: Exception) { |
| | | e.printStackTrace() |
| | | null |
| | | } |
| | | return Date() |
| | | } |
| | | |
| | | fun parseYearToMin(str: String): Date { |