CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Task #13683

Merge timeRestriction/date/month/year demand

Added by Nikolas Hagelstein about 2 years ago. Updated 4 months ago.

Status:Resolved Start date:2011-03-08
Priority:Must have Due date:
Assignee:Nikolas Hagelstein % Done:

100%

Category:Core
Target version:1.0.0
TYPO3 Version:4.5 Has patch:No
PHP Version: Complexity:
Votes: 0

Description

Actually "timeRestriction" is just a special case of dateField fromDate ToDate.

so we should restructure things.


Related issues

related to Extension news - Feature #33847: Add flexible datefilter constraint Rejected 2012-02-10

Associated revisions

Revision 45123
Added by Nikolas Hagelstein about 2 years ago

[~BUGFIX]: Time restriction guard clause was to strict. Relates to #13683

Revision 3139d492
Added by Nikolas Hagelstein about 2 years ago

[~BUGFIX]: Time restriction guard clause was to strict. Relates to #13683

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/news2/trunk@45123 735d13b6-9817-0410-8766-e36946ffe9aa

History

Updated by Nikolas Hagelstein about 2 years ago

  • Status changed from New to Accepted

Updated by Georg Ringer about 2 years ago

The feature is simply explained:
A time restriction can be set which works on the field "datetime". If you enter an integer, it is meant to be seconds which a news record is maximum to be old. If it is a timestring, strotime is used to get the age.

Examples:
- Add "-8 days" to get all news records which are max. 8 days old.
- Add "518400" to get all news records which are max 6 days old (86400 * 6)

There is a unit test covering this 2 examples > findLatestLimitRecords() - so it should be easy to change everything.

Updated by Nikolas Hagelstein about 2 years ago

  • Status changed from Accepted to Needs Feedback

After thinking about this for a while, i reasoned that we should refactor the timeRestriction/dateField/Month/Year thing as follows:

- Drop timeRestriction
- Introduce fromDate and toDate (to settings and demand).
- Both fields should accept any format that str2time is capable of.
- Both Fields are settable for list and dateMenu
- Both fields apply to whatever you configured via dateField

Imho this would give us a lot more flexibility compared to what we have right now (mostly due to the str2time, relative format magic, e.g -1w to +1w .

Anyway there is one drawback:
Nice looking URLS! E.g the link from the dateMenu for feb/11 would look like
?...tx_news2_pi1[overrideDemand][fromData]=2011-01-01&tx_news2_pi1[overrideDemand][toData]=2011-02-01

Though i am pretty sure this could by solved with some realurl magic i would like to hear your opinion before implementing it.

Updated by Georg Ringer about 2 years ago

  • Status changed from Needs Feedback to Accepted

looks good, go ahead

Updated by Christian Mueller over 1 year ago

Nicolas, did you already start with this?

Actually I wanted to add only support for dateMenu with year restriction only (so eg. link to all news from 2010), but I could try to refactor in this direction as my request would be included in this so it doesn't make much sense to add code for that and then refactor everything again...

Updated by Steffen Müller over 1 year ago

  • TYPO3 Version set to 4.5
  • Patch is reviewed set to No
  • Has patch set to No

Any news here?

Updated by Georg Ringer 4 months ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

it works alreay this way, just wording is a bit ugly getTimeRestriction/getTimeRestrictionHigh

Also available in: Atom PDF