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

Reference date when creating Context #11

Closed
hfinck opened this issue Jul 19, 2016 · 2 comments
Closed

Reference date when creating Context #11

hfinck opened this issue Jul 19, 2016 · 2 comments

Comments

@hfinck
Copy link
Contributor

hfinck commented Jul 19, 2016

Is it necessary to include a reference date when creating a Context?
@tgallice I assume you had reasons to put it there, but I feel this might not be useful for everyone.
I also reached out to wit.ai if fields like this, which in my case are not used, can confuse the bot model, but I did not receive any answer yet.
I would be glad if you can explain why it's there and if we generally need it.

    public function __construct($data = [])
    {
        // Ensure the refenre_date field
        if (empty($data['reference_date'])) {
            $data['reference_date'] = new \DateTime();
        }

        if ($data['reference_date'] instanceof \DateTime) {
            $data['reference_date'] = $data['reference_date']->format(DATE_ISO8601);
        }

        $this->data = $data;
    }
@tgallice
Copy link
Owner

If my memory is good, the reference_date help to define time entities. e.g tomorow, today etc... It's there to ensure that.

Maybe today it's not needed anymore, the Context is deprecated but nothing is defined to replace it... If you have some news, let me know :)

@hfinck
Copy link
Contributor Author

hfinck commented Jul 26, 2016

Ah ok. I think they dropped this in favor of configuring a default timezone on the app.
This is convenient, but complicates things if you deal with users who are in different timezones :-(

@hfinck hfinck closed this as completed Aug 10, 2016
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

2 participants