Skip to content

Commit

Permalink
5 tasks from lesson 5 are done (Attempt Kotlin-Polytech#2).
Browse files Browse the repository at this point in the history
  • Loading branch information
Iksburg committed Oct 30, 2020
1 parent 022f332 commit 03cb38e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lesson6/task1/Parse.kt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fun dateStrToDigit(str: String): String {
|| month == "2" && (parts[2].toInt() % 4 == 0 && parts[0].toInt() < 30
|| parts[2].toInt() % 4 != 0 && parts[0].toInt() < 29))
) {
String.format("%02d.%02d.%04d", parts[0].toInt(), month.toInt(), parts[2].toInt())
String.format("%02d.%02d.%d", parts[0].toInt(), month.toInt(), parts[2].toInt())
} else {
""
}
Expand Down
1 change: 1 addition & 0 deletions test/lesson6/task1/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Tests {
@Test
@Tag("4")
fun dateStrToDigit() {
assertEquals("01.01.1", dateStrToDigit("01 января 1"))
assertEquals("15.07.2016", dateStrToDigit("15 июля 2016"))
//assertEquals("", dateStrToDigit("3 мартобря 1918"))
assertEquals("18.11.2018", dateStrToDigit("18 ноября 2018"))
Expand Down

0 comments on commit 03cb38e

Please sign in to comment.