Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate Carbon Date Format #224

Open
dragonfly4 opened this issue Feb 27, 2024 · 1 comment
Open

Translate Carbon Date Format #224

dragonfly4 opened this issue Feb 27, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@dragonfly4
Copy link

This package has been translated to multiple languages. When displaying dates using the API functions it's always in English and not following the active language.

Example

public function getDate()
{
return $this->date->format($this->date_format);
}

->format follows the PHP Date Format options which always returns English.

Example with 26/02/2024

26 Feb 2024

In Carbon you can use translatedFormat to display the date in the correct language.
https://carbon.nesbot.com/docs/#api-localization

 public function getDate() 
 { 
     return $this->date->translatedFormat($this->date_format); 
 } 

26 févr. 2024

Instead of using CustomData it could be useful to support this in the package.

@mc0de mc0de added the enhancement New feature or request label Feb 27, 2024
@mc0de
Copy link
Collaborator

mc0de commented Feb 27, 2024

@dragonfly4 well pointed, I will review this at some point

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants