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

Dates of activities save as 1 day previous #2074

Closed
jyrodgers opened this issue Nov 20, 2018 · 5 comments · Fixed by #2241
Closed

Dates of activities save as 1 day previous #2074

jyrodgers opened this issue Nov 20, 2018 · 5 comments · Fixed by #2241
Assignees
Labels

Comments

@jyrodgers
Copy link

(Note: you don't need to follow this template, nor to keep headlines or bold sentences - they are just there to guide you. Feel free to delete everything. We review every issue even if we don't immediately respond.)

Thanks for filing an issue and for your interest in the project.

Describe the bug
When I enter an activity with a contact and save it, the date on the date of that activity in the log is for the previous day. Example: If I enter the date of the activity as 2018-10-17 the activity in the log is 2018-10-16.

Screenshots

screen shot 2018-11-20 at 2 58 11 pm

screen shot 2018-11-20 at 2 58 23 pm

Which version are you using:

@djaiss
Copy link
Member

djaiss commented Nov 21, 2018

Oh I see what's going on here.
The date is correctly saved but timezone is taken into account when displaying the information - which is wrong somehow. We need to fix this.

@djaiss djaiss added the bug label Nov 21, 2018
@tbirrell
Copy link

tbirrell commented Nov 26, 2018

There are two viable solutions to this problem as I see it.

  1. Stop using DateHelper in activity/index.blade.php.
  2. Refactor DateHelper to allow skipping the TZ check for the various methods

The first option fixes the immediate problem, though perhaps at the detriment of consistency.

The second option would look something like:

public static function getShortDate($date, $faceValue = false)
{
    $date = new Date($date, ($faceValue ? null : static::getTimezone()));
    $format = trans('format.short_date_year', [], Date::getLocale());

    return $date->format($format) ?: '';
}

If we went that route, this should be done to all the DateHelper methods for consistency's sake and would default to existing behavior, so should not affect anything. But it would allow us to display the datetimestamps at face value when necessary.

@johnriley
Copy link

Any update on this?

@djaiss djaiss self-assigned this Dec 26, 2018
@danielbachhuber
Copy link

I've seen this issue too!

To confirm, the date stored is correct, but the display date is incorrect? If this is the case, then I'm experiencing #2192 too.

@github-actions
Copy link

This issue has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants