Skip to content

dateFormat "could not be converted to a valid timestamp" #35

@teaqu

Description

@teaqu

Hello,

If you set a custom dateFormat the following code will throw a "could not be converted to a valid timestamp" exception.

$record = $this->fileMaker->createRecord('layout', $data);
$record->commit();

The reason seems to be that DateFormat::convert() is run twice. First in Record::setField() and then later in Add::setField(). The problem with this is that DateFormat will try to convert an already converted value.

This issue can be avoided if I run:

$this->fileMaker->newAddCommand('layout', $data)->execute();

as then setField() is only run in Add.

One way to stop this issue could be to avoid conversions on dates that are already in the m/d/Y format. What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions