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

Default Date format #342

Open
v1har opened this issue Jan 17, 2024 · 2 comments
Open

Default Date format #342

v1har opened this issue Jan 17, 2024 · 2 comments

Comments

@v1har
Copy link

v1har commented Jan 17, 2024

SDK you're using (please complete the following information):

  • Version 2.32.2

Is your feature request related to a problem? Please describe.
I am facing an issue with the new MS Dateformat in Accounting API, because my application uses the Date key everywhere for all objects (Invoice, Credit Note, etc) and now the code shows wrong date for these objects. I would like a setting to use custom format for date objects.

Describe the solution you'd like
In Configuration.php (or in a configuration file) I would set the default date format for Date and Datetime objects too. Then the date getter functions would return with the date in that custom format. In my case I would set 'YYYY-MM-DD' for Date and 'YYYY-MM-DD HH:ii:ss' for DateTime objects.

Additional context
What I changed on my end in the Invoice.php:

public function setDate($date){
	// $this->container['date'] = $date;

	$dateObject = StringUtil::convertStringToDateTime($date);
        $this->container['date'] = $dateObject->format('Y-m-d H:i:s');

        return $this;
}
Copy link

PETOSS-384

Copy link

Thanks for raising an issue, a ticket has been created to track your request

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

No branches or pull requests

1 participant