Bug #33629

datepicker with datetime field does not set current time as default

Added by Simon Schaufelberger almost 8 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Category:
Backend User Interface
Target version:
Start date:
2012-02-02
Due date:
% Done:

0%

TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In tt_news for example i have a datetime field. When i pick a date with the datepicker, the default time is set to 0:00. Changeing the time manually and picking another day overwrites the time again to 0:00

I would expect that the time is set to the current time and will not change when picking another day with the datepicker.

This issue is related to #25043.

tceforms_date_datetime_4.5.patch View (13.1 KB) Benni Mack, 2012-03-15 14:16


Related issues

Related to TYPO3 Core - Bug #25043: datetime picker returns only a date and no time value Closed 2011-02-15
Related to TYPO3 Core - Bug #26674: Regression bug in tceforms.js Closed 2011-05-06
Related to TYPO3 Core - Bug #31027: Date picker defect Closed 2011-10-17

Associated revisions

Revision 218f304d (diff)
Added by Simon Schaufelberger over 7 years ago

[BUGFIX] datepicker does not set current time as default

Changeing the time manually and picking another day overwrites the time
and sets it again to 0:00.

Change-Id: Iae80b9519df2a49b8d1ed1e5d5f1082243ca4fe6
Fixes: #33629
Releases: 4.5
Reviewed-on: http://review.typo3.org/11568
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Ernesto Baschny
Tested-by: Ernesto Baschny

Revision 9c326846 (diff)
Added by Christian Kuhn almost 7 years ago

[BUGFIX] Load date-time picker in scheduler module

The date-time picker must be loaded explicitly.

Fix for regression #31027 that was introduced to 4.5 with
issue #33629

Change-Id: I06014d1a3ed9ce6584272632f1532ba1bcf92843
Fixes: #31027
Related: #33629
Releases: 4.5
Reviewed-on: https://review.typo3.org/17765
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

History

#1 Updated by Simon Schaufelberger almost 8 years ago

The main source part is in:
t3lib/js/extjs/tceforms.js starting from line 63.

i changed to code to this:

if (index === 1 && oldValue !== undefined) {
        //datetimefield, preserve time information
    date.setHours(oldValue.getHours());
    date.setMinutes(oldValue.getMinutes());
} else {
    oldValue = Date();
    date.setHours(oldValue.getHours());
    date.setMinutes(oldValue.getMinutes());
}

but this does not solve the overwriting of the now current time.

#2 Updated by Benni Mack over 7 years ago

Attached is a patch that backports all necessary files from 4.6 to 4.5 (the only version where this is happening).

Thanks to punkt.de for fixing this bug!

#3 Updated by Simon Schaufelberger over 7 years ago

hi Benny!
thank you very much! Can you do me a favor and push this to gerrit please?

#4 Updated by Jigal van Hemert over 7 years ago

Please ask the RM of 4.5 (Ernesto) if he wants this feature backported. If he agrees the patch can be pushed to the TYPO3_4-5_backports branch.

#5 Updated by Simon Schaufelberger over 7 years ago

  • Assignee set to Ernesto Baschny
  • Target version set to 4.5.14

Hi Ernesto,
can this BUG be backported to 4.5? This was working well in earlier releases like expected.

#6 Updated by Ernesto Baschny over 7 years ago

  • Category set to Backend User Interface
  • Status changed from New to Accepted
  • Target version changed from 4.5.14 to 4.5.16

@Simon, thanks for bringing that to my attention by mail. I have missed the notification from Forge for this issue.

This seems to be an usability fix and indeed this can and should be solved also on 4.5. The backport from Benni seems to work, and as it clearly fixes the bug it can of course be backported. Remains to be evaluated during the review if there aren't any other side-effects, but since the code works on 4.6 and later, it should be ok.

+1 on backporting

#7 Updated by Gerrit Code Review over 7 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/11568

#8 Updated by Gerrit Code Review over 7 years ago

Patch set 2 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/11568

#9 Updated by Ernesto Baschny over 7 years ago

  • Status changed from Under Review to Resolved
  • Target version changed from 4.5.16 to 4.5.18

Merged in 4.5. Thanks!

#10 Updated by Riccardo De Contardi about 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF