ttrack:start

# Differences

This shows you the differences between two versions of the page.

 ttrack:start [2012/12/11 12:09]andy ttrack:start [2012/12/11 12:16] (current)andy [Time/Date Parsing] Both sides previous revision Previous revision 2012/12/11 12:16 andy [Time/Date Parsing] 2012/12/11 12:09 andy 2012/11/28 18:24 andy created 2012/12/11 12:16 andy [Time/Date Parsing] 2012/12/11 12:09 andy 2012/11/28 18:24 andy created Line 22: Line 22: Note the inconsistency where "​this"​ becomes synonymous with "​next"​ for the current day --- this reflects the fact that I don't believe someone would ever say "this Wednesday"​ if they meant "​today"​. Note the inconsistency where "​this"​ becomes synonymous with "​next"​ for the current day --- this reflects the fact that I don't believe someone would ever say "this Wednesday"​ if they meant "​today"​. + + The algorithms for each version are thus (assuming ''<​weekday>''​ and ''<​current weekday>''​ have been converted to zero-based integers where Monday is zero): + + * **''"​last <​weekday>"''​** + * ''<​new date> = - - 7 + <​weekday>''​ + * **''"​this <​weekday>"''​** + * ''​if <​weekday>​ == :''​ + * ''<​new date> = + 7''​ + * ''​else:''​ + * ''<​new date> = - + <​weekday>''​ + * **''"​next <​weekday>"''​** + * ''<​new date> = - + 7 + <​weekday>''​ A bare day of the week (e.g. just "​Tuesday"​) is always taken as the day of the //current// week (Monday-based),​ as opposed to some date parsing packages which regard this as synonymous with "next Tuesday"​. This means it doesn'​t quite correspond exactly with any of the last/​this/​next interpretations,​ but that's probably OK. A bare day of the week (e.g. just "​Tuesday"​) is always taken as the day of the //current// week (Monday-based),​ as opposed to some date parsing packages which regard this as synonymous with "next Tuesday"​. This means it doesn'​t quite correspond exactly with any of the last/​this/​next interpretations,​ but that's probably OK.