$weeks = floor($days / 7);
$hours = $interval->format('%h');
$minutes = $interval->format('%i');
+ switch ($interval->format('%R')) {
+ case '+':
+ $direction = 'past';
+ break;
+ case '-':
+ $direction = 'future';
+ break;
+ }
if ($fullInterval) {
- return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.full', array(
+ return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.full.'.$direction, array(
'days' => $days - 7 * $weeks,
'firstElement' => $years ? 'years' : ($months ? 'months' : ($weeks ? 'weeks' : ($days ? 'days' : ($hours ? 'hours' : 'minutes')))),
'hours' => $hours,
}
if ($years) {
- return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.years', array(
+ return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.years.'.$direction, array(
'years' => $years
));
}
if ($months) {
- return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.months', array(
+ return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.months.'.$direction, array(
'months' => $months
));
}
if ($weeks) {
- return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.weeks', array(
+ return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.weeks.'.$direction, array(
'weeks' => $weeks
));
}
if ($days) {
- return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.days', array(
+ return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.days.'.$direction, array(
'days' => $days
));
}
if ($hours) {
- return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.hours', array(
+ return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.hours.'.$direction, array(
'hours' => $hours
));
}
- return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.minutes', array(
+ return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.minutes.'.$direction, array(
'minutes' => $minutes
));
}
<item name="wcf.date.timeFormat"><![CDATA[H:i]]></item>
<item name="wcf.date.dateTimeFormat"><![CDATA[%date%, %time%]]></item>
- <item name="wcf.date.interval.days"><![CDATA[Vor {if $days > 1}{#$days} Tagen{else}einem Tag{/if}]]></item>
- <item name="wcf.date.interval.full"><![CDATA[Vor {if $years}{if $years > 1}{#$years} Jahren{else}einem Jahr{/if}{/if}{if $months}{if $firstElement != 'months'}{if $lastElement == 'months'} und {else}, {/if}{/if}{if $months > 1}{#$months} Monaten{else}einem Monat{/if}{/if}{if $weeks}{if $firstElement != 'weeks'}{if $lastElement == 'weeks'} und {else}, {/if}{/if}{if $weeks > 1}{#$weeks} Wochen{else}einer Woche{/if}{/if}{if $days}{if $firstElement != 'days'}{if $lastElement == 'days'} und {else}, {/if}{/if}{if $days > 1}{#$days} Tagen{else}einem Tag{/if}{/if}{if $hours}{if $firstElement != 'hours'}{if $lastElement == 'hours'} und {else}, {/if}{/if}{if $hours > 1}{#$hours} Stunden{else}einer Stunde{/if}{/if}{if $minutes}{if $firstElement != 'minutes' && $lastElement == 'minutes'} und {/if}{if $minutes > 1}{#$minutes} Minuten{else}einer Minute{/if}{/if}]]></item>
- <item name="wcf.date.interval.hours"><![CDATA[Vor {if $hours > 1}{#$hours} Stunde{else}einer Stunde{/if}]]></item>
- <item name="wcf.date.interval.minutes"><![CDATA[Vor {if $minutes > 1}{#$minutes} Minuten{else}einer Minute{/if}]]></item>
- <item name="wcf.date.interval.months"><![CDATA[Vor {if $months > 1}{#$months} Monaten{else}einem Monat{/if}]]></item>
- <item name="wcf.date.interval.weeks"><![CDATA[Vor {if $weeks > 1}{#$weeks} Wochen{else}einer Woche{/if}]]></item>
- <item name="wcf.date.interval.years"><![CDATA[Vor {if $years > 1}{#$years} Jahren{else}einem Jahr{/if}]]></item>
+ <item name="wcf.date.interval.days.past"><![CDATA[Vor {if $days > 1}{#$days} Tagen{else}einem Tag{/if}]]></item>
+ <item name="wcf.date.interval.full.past"><![CDATA[Vor {if $years}{if $years > 1}{#$years} Jahren{else}einem Jahr{/if}{/if}{if $months}{if $firstElement != 'months'}{if $lastElement == 'months'} und {else}, {/if}{/if}{if $months > 1}{#$months} Monaten{else}einem Monat{/if}{/if}{if $weeks}{if $firstElement != 'weeks'}{if $lastElement == 'weeks'} und {else}, {/if}{/if}{if $weeks > 1}{#$weeks} Wochen{else}einer Woche{/if}{/if}{if $days}{if $firstElement != 'days'}{if $lastElement == 'days'} und {else}, {/if}{/if}{if $days > 1}{#$days} Tagen{else}einem Tag{/if}{/if}{if $hours}{if $firstElement != 'hours'}{if $lastElement == 'hours'} und {else}, {/if}{/if}{if $hours > 1}{#$hours} Stunden{else}einer Stunde{/if}{/if}{if $minutes}{if $firstElement != 'minutes' && $lastElement == 'minutes'} und {/if}{if $minutes > 1}{#$minutes} Minuten{else}einer Minute{/if}{/if}]]></item>
+ <item name="wcf.date.interval.hours.past"><![CDATA[Vor {if $hours > 1}{#$hours} Stunde{else}einer Stunde{/if}]]></item>
+ <item name="wcf.date.interval.minutes.past"><![CDATA[Vor {if $minutes > 1}{#$minutes} Minuten{else}einer Minute{/if}]]></item>
+ <item name="wcf.date.interval.months.past"><![CDATA[Vor {if $months > 1}{#$months} Monaten{else}einem Monat{/if}]]></item>
+ <item name="wcf.date.interval.weeks.past"><![CDATA[Vor {if $weeks > 1}{#$weeks} Wochen{else}einer Woche{/if}]]></item>
+ <item name="wcf.date.interval.years.past"><![CDATA[Vor {if $years > 1}{#$years} Jahren{else}einem Jahr{/if}]]></item>
+
+ <item name="wcf.date.interval.days.future"><![CDATA[In {if $days > 1}{#$days} Tagen{else}einem Tag{/if}]]></item>
+ <item name="wcf.date.interval.full.future"><![CDATA[In {if $years}{if $years > 1}{#$years} Jahren{else}einem Jahr{/if}{/if}{if $months}{if $firstElement != 'months'}{if $lastElement == 'months'} und {else}, {/if}{/if}{if $months > 1}{#$months} Monaten{else}einem Monat{/if}{/if}{if $weeks}{if $firstElement != 'weeks'}{if $lastElement == 'weeks'} und {else}, {/if}{/if}{if $weeks > 1}{#$weeks} Wochen{else}einer Woche{/if}{/if}{if $days}{if $firstElement != 'days'}{if $lastElement == 'days'} und {else}, {/if}{/if}{if $days > 1}{#$days} Tagen{else}einem Tag{/if}{/if}{if $hours}{if $firstElement != 'hours'}{if $lastElement == 'hours'} und {else}, {/if}{/if}{if $hours > 1}{#$hours} Stunden{else}einer Stunde{/if}{/if}{if $minutes}{if $firstElement != 'minutes' && $lastElement == 'minutes'} und {/if}{if $minutes > 1}{#$minutes} Minuten{else}einer Minute{/if}{/if}]]></item>
+ <item name="wcf.date.interval.hours.future"><![CDATA[In {if $hours > 1}{#$hours} Stunde{else}einer Stunde{/if}]]></item>
+ <item name="wcf.date.interval.minutes.future"><![CDATA[In {if $minutes > 1}{#$minutes} Minuten{else}einer Minute{/if}]]></item>
+ <item name="wcf.date.interval.months.future"><![CDATA[In {if $months > 1}{#$months} Monaten{else}einem Monat{/if}]]></item>
+ <item name="wcf.date.interval.weeks.future"><![CDATA[In {if $weeks > 1}{#$weeks} Wochen{else}einer Woche{/if}]]></item>
+ <item name="wcf.date.interval.years.future"><![CDATA[In {if $years > 1}{#$years} Jahren{else}einem Jahr{/if}]]></item>
<!-- variables for dynamic javascript datetime -->
<item name="wcf.date.relative.minutes"><![CDATA['Vor ' + (($minutes > 1) ? $minutes + ' Minuten' : 'einer Minute' )]]></item>