-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/short names instead numbers (#6)
* Add building for Starting At week day setup by short name * Extend At function * Fix tests * Add Starting At short week day name parsing support * Add tests * Extend On function * Fix and add tests * Add Of Month short week day name parsing support * Add tests * Increase version * Update README
- Loading branch information
Showing
13 changed files
with
73 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
package com.ucasoft.kcron.extensions | ||
|
||
class At(private val every: Int, private val starting: Int) { | ||
import com.ucasoft.kcron.common.WeekDays | ||
|
||
class At(private val every: Int, private val starting: String) { | ||
constructor(every: Int, starting: WeekDays) : this(every, starting.shortName) | ||
|
||
override fun toString() = "$starting/$every" | ||
} | ||
|
||
infix fun Int.at(starting: Int) : At = At(this, starting) | ||
infix fun Int.at(starting: Int) : At = At(this, starting.toString()) | ||
|
||
infix fun Int.at(starting: WeekDays) : At = At(this, starting) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
package com.ucasoft.kcron.extensions | ||
|
||
class On(private val dayOfWeek: Int, private val index: Int) { | ||
import com.ucasoft.kcron.common.WeekDays | ||
|
||
class On(private val dayOfWeek: String, private val index: Int) { | ||
constructor(dayOfWeek: WeekDays, index: Int) : this(dayOfWeek.shortName, index) | ||
|
||
override fun toString() = "$dayOfWeek#$index" | ||
} | ||
|
||
infix fun Int.on(index: Int) : On = On(this, index) | ||
infix fun Int.on(index: Int) : On = On(this.toString(), index) | ||
|
||
infix fun WeekDays.on(index: Int) : On = On(this, index) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters