Skip to content

Default Date format #342

@v1har

Description

@v1har

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions