| | |
| | | switch type{ |
| | | case .YMD: |
| | | let year = years[pickerView.selectedRow(inComponent: 0)] |
| | | let month = months[pickerView.selectedRow(inComponent: 1)] |
| | | var month = months[pickerView.selectedRow(inComponent: 1)] |
| | | |
| | | if year == Date().jq_nowYear(){ |
| | | month = Date().jq_nowMonth() - pickerView.selectedRow(inComponent: 1) |
| | | } |
| | | if year == Date().jq_nowYear() && month == Date().jq_nowMonth(){ |
| | | return Date().jq_nowDay() |
| | | }else{ |
| | |
| | | if component == 1{ |
| | | switch type{ |
| | | case .YM,.YMD: |
| | | let nowMonth = Date().jq_nowMonth() |
| | | if pickerView.selectedRow(inComponent: 0) == 0{ |
| | | return "\(11 - Date().jq_nowMonth() - row - 1)月" |
| | | return "\(nowMonth - row)月" |
| | | } |
| | | return "\(months[row])月" |
| | | case .HHmm:return String(format: "%02ld分", minutes[row]) |