Skip to content

Migrate away from java.time for i18n purposes #3649

Description

@MajorTanya

Describe your suggested feature

Followup to #1947 & #3001.

During my work on #3001, I noticed that kotlinx.datetime / kotlin.time have zero support for any localised dates (e.g. start of week day etc) (which is explicitly listed as a non-goal of kotlinx.datetime:

Internationalization (such as locale-specific month and day names) is out of the scope, too.

For now, we still use Java versions of date and time interfaces wherever we localise dates.

These include the following places:

Targets
    Occurrences of 'import java\.(time|util.Date)' in Project
Found occurrences in Project  (34 usages found)
    Unclassified  (34 usages found)
        Mihon.app.main  (22 usages found)
            BackupCreator.kt  (1 usage found)
                BackupCreator.kt  (1 usage found)
                    36 import java.util.Date
            BackupHistory.kt  (1 usage found)
                BackupHistory.kt  (1 usage found)
                    6 import java.util.Date
            BackupRestorer.kt  (1 usage found)
                BackupRestorer.kt  (1 usage found)
                    31 import java.util.Date
            Calendar.kt  (3 usages found)
                Calendar.kt  (3 usages found)
                    30 import java.time.DayOfWeek
                    31 import java.time.format.TextStyle
                    32 import java.time.temporal.WeekFields
            CalendarHeader.kt  (1 usage found)
                CalendarHeader.kt  (1 usage found)
                    34 import java.time.format.DateTimeFormatter
            DateExtensions.kt  (3 usages found)
                DateExtensions.kt  (3 usages found)
                    16 import java.time.format.DateTimeFormatter
                    17 import java.time.format.FormatStyle
                    18 import java.util.Date
            HistoryviewModelStateProvider.kt  (1 usage found)
                HistoryviewModelStateProvider.kt  (1 usage found)
                    9 import java.util.Date
            HistoryWithRelationsProvider.kt  (1 usage found)
                HistoryWithRelationsProvider.kt  (1 usage found)
                    5 import java.util.Date
            KitsuDateHelper.kt  (1 usage found)
                KitsuDateHelper.kt  (1 usage found)
                    4 import java.util.Date
            KitsuSearch.kt  (1 usage found)
                KitsuSearch.kt  (1 usage found)
                    8 import java.util.Date
            MangaRestorer.kt  (1 usage found)
                MangaRestorer.kt  (1 usage found)
                    28 import java.util.Date
            ReaderViewModel.kt  (1 usage found)
                ReaderViewModel.kt  (1 usage found)
                    79 import java.util.Date
            TrackerSearchPreviewProvider.kt  (1 usage found)
                TrackerSearchPreviewProvider.kt  (1 usage found)
                    9 import java.util.Date
            TrackInfoDialogHome.kt  (1 usage found)
                TrackInfoDialogHome.kt  (1 usage found)
                    65 import java.time.format.DateTimeFormatter
            TrackInfoDialogHomePreviewProvider.kt  (2 usages found)
                TrackInfoDialogHomePreviewProvider.kt  (2 usages found)
                    8 import java.time.format.DateTimeFormatter
                    9 import java.time.format.FormatStyle
            UiPreferences.kt  (2 usages found)
                UiPreferences.kt  (2 usages found)
                    11 import java.time.format.DateTimeFormatter
                    12 import java.time.format.FormatStyle
        Mihon.data.main  (9 usages found)
            data\History.kt  (1 usage found)
                History.kt  (1 usage found)
                    4 import java.util.Date
            DatabaseAdapter.kt  (1 usage found)
                DatabaseAdapter.kt  (1 usage found)
                    7 import java.util.Date
            GetLatestHistory.kt  (1 usage found)
                GetLatestHistory.kt  (1 usage found)
                    3 import java.util.Date
            history.sq  (1 usage found)
                history.sq  (1 usage found)
                    1 import java.util.Date;
            HistoryMapper.kt  (1 usage found)
                HistoryMapper.kt  (1 usage found)
                    6 import java.util.Date
            HistoryQueries.kt  (1 usage found)
                HistoryQueries.kt  (1 usage found)
                    8 import java.util.Date
            HistoryView.kt  (1 usage found)
                HistoryView.kt  (1 usage found)
                    3 import java.util.Date
            HistoryViewQueries.kt  (1 usage found)
                HistoryViewQueries.kt  (1 usage found)
                    8 import java.util.Date
            view\History.kt  (1 usage found)
                History.kt  (1 usage found)
                    3 import java.util.Date
        Mihon.domain.main  (3 usages found)
            HistoryUpdate.kt  (1 usage found)
                HistoryUpdate.kt  (1 usage found)
                    3 import java.util.Date
            HistoryWithRelations.kt  (1 usage found)
                HistoryWithRelations.kt  (1 usage found)
                    4 import java.util.Date
            model\History.kt  (1 usage found)
                History.kt  (1 usage found)
                    3 import java.util.Date

Other details

No response

Acknowledgements

  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open or closed issue.
  • I have written a short but informative title.
  • I have updated the app to version 0.20.1.
  • I will fill out all of the requested information in this form.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions