nextcloud / talk-android

📱😀 Video & audio calls through Nextcloud on Android
Other
565 stars 248 forks source link

Migrate from usage of APIs under java.util when dealing with date and time. #4274

Open parneet-guraya opened 2 months ago

parneet-guraya commented 2 months ago

We should remove the usage of APIs related date and time from java.util package. Why? See below ->

From oracle's site link :

Why do we need a new date and time library?

A long-standing bugbear of Java developers has been the inadequate support for the date and time use cases of ordinary developers.

In order to address these problems and provide better support in the JDK core, a new date and time API, which is free of these problems, has been designed for Java SE 8.

This stackoverflow answer explains it well too.

Also, not only from above I have personally encountered bugs and weird outputs. Also, less intuitive meaning more chances of introducing bugs while maintaining or writing new code.

So, I make the case to migrate from this to some other solution like APIs from java.time which in fact was introduced to overcome the shortcomings of above.

Let me know @mahibi

mahibi commented 2 months ago

Makes sense. Maybe also interesting for @rapterjet2004 regarding the DateTimePickerFragment

migulen commented 2 months ago

@parneet-guraya I found the same on stackoverflow when I was looking at #4248 , but I thought that asking for that way was too much. ;-)