spacedriveapp / spacedrive

Spacedrive is an open source cross-platform file explorer, powered by a virtual distributed filesystem written in Rust.

Home Page:https://spacedrive.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Formatting dates with i18n

artsiom-voitas opened this issue · comments

Describe the bug

Currently, Spacedrive formats dates, for example on (spacedrive\interface\app$libraryId\Explorer\Inspector\index.tsx):
<MetaData icon={Eraser} label={t('modified')} value={formatDate(dateModified)} />
using JavaScript capabilities, which makes it impossible to have date mapping in different languages.
It is worth considering using the i18n functions provided in the documentation

Reproduction

  1. Check date in Inspector

Expected behavior

Date formatting matches app language.

Platform and versions

spacedrive - v0.2.13

Stack trace

No response

Additional context

No response

commented

We should tackle this #2389 with this issue also

We should tackle this #2389 with this issue also

Do you want to add Date Format selector in the settings? Somewhere under Language settings? If yes, I will continue work on this matter tomorrow, if you want to format according to language preferences, I can push it now

commented

Do you want to add Date Format selector in the settings? Somewhere under Language settings? If yes, I will continue work on this matter tomorrow, if you want to format according to language preferences, I can push it now

Yes, I think we should default to the local time settings and user should also be able to change it

Do you want to add Date Format selector in the settings? Somewhere under Language settings? If yes, I will continue work on this matter tomorrow, if you want to format according to language preferences, I can push it now

Yes, I think we should default to the local time settings and user should also be able to change it

Is it good idea to make a changes to local time from chosen language? For example, We add two versions of English:

  1. English (US): which will match key en_US and bring us MM/DD/Year and 12 hours formatting
  2. English (UK): which will math key en_UK and bring us DD/MM/Year and 24 hours formatting
    Also, we will have a feature in settings to change preferable date formatting style, from the list
    image
    Does It sound correct?
commented

yup, options like "System", "DD/MM/YYYY", "M/D/Y" would be nice. And for extra points, we could display how it would look under the time display setting so it's easily understandable.

System would use whatever the default locale setting for that country is. (this would also be the default setting)