mirror of
				https://github.com/InsanusMokrassar/krontab.git
				synced 2025-11-04 05:20:41 +00:00 
			
		
		
		
	potential fix of #65
This commit is contained in:
		@@ -2,6 +2,8 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
## 2.2.1
 | 
					## 2.2.1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Potential fix of [#65](https://github.com/InsanusMokrassar/krontab/issues/65)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## 2.2.0
 | 
					## 2.2.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* Versions
 | 
					* Versions
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -108,13 +108,19 @@ internal fun NearDateTimeCalculatorDays(
 | 
				
			|||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            dateTime
 | 
					            dateTime
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
        dateTime.copy(
 | 
					        val newDateTime = dateTime.copy(
 | 
				
			||||||
            dayOfMonth = min(dateTime.month.days(dateTime.year), newOne.toInt() + 1), // index1
 | 
					            dayOfMonth = min(dateTime.month.days(dateTime.year), newOne.toInt() + 1), // index1
 | 
				
			||||||
            hour = 0,
 | 
					            hour = 0,
 | 
				
			||||||
            minute = 0,
 | 
					            minute = 0,
 | 
				
			||||||
            second = 0,
 | 
					            second = 0,
 | 
				
			||||||
            milliseconds = 0
 | 
					            milliseconds = 0
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					        // If day of month has not been changed, use old dateTime due to no changes required
 | 
				
			||||||
 | 
					        if (newDateTime.dayOfMonth == dateTime.dayOfMonth) {
 | 
				
			||||||
 | 
					            dateTime
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            newDateTime
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user