samanzamani / PersianDate

Persian date for android
BSD 3-Clause "New" or "Revised" License
328 stars 40 forks source link

Doesn't compile on API levels lower than 26 #72

Closed roozbehzarei closed 2 years ago

roozbehzarei commented 2 years ago

PersianDate makes use of the java.time.* packages which were added on API level 26 (Android 8.0), hence not compiling for API levels below that. I suggest replacing them with kotlinx-datetime to resolve compatibility issues.

samanzamani commented 2 years ago

Hi @roozbehzarei Basically, I don't use java.time class directly. I use java.util.Calendar and java.util.Date classes which those classes use java.time.Instant. Actually Calendar and Date are interpreted differently in different SDK versions because these two classes are available since SDK v1. So you can use this package for SDK greater than 14. I've tested the sample application on SDK v24 and it worked. Let me know if you had some problems with running application which uses this library.