Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

URL convention for date range

What would be the accepted convention for displaying a date range in a friendly URL?

For example, in a time tracking application. Instead of using the database's primary key for a specific pay period in the URL, I would like to use something more easily distinguishable to the user.

http://www.mytimesheet.com/11-1-2009-11-14-2009
http://www.mytimesheet.com/period-beginning-11-1-2009

Neither of those seem to cut it, but maybe I'm just being overly critical.

like image 552
Jason B Avatar asked Nov 11 '09 13:11

Jason B


3 Answers

Have you considered ISO format dates, especially in their compact form: YYYYMMDD, then it should be possible to have:

http://example.com/dates/20091101/20091131

Specifically I don't think there is any accepted convention for this.

Edit: this is about routing as well...

like image 64
Richard Avatar answered Oct 18 '22 13:10

Richard


I'd say it's up to you, but I like the idea of

http://foo.com/bar/from/2008/
http://foo.com/bar/from/2008/10/
http://foo.com/bar/from/2008/10/02

Or, it can be combined with something like /between/2008/10/2009/10 and such.

like image 2
Tamas Mezei Avatar answered Oct 18 '22 15:10

Tamas Mezei


I'd either use something like:

http://www.mytimesheet.com/start/11-1-2009/end/11-14-2009

or

http://www.mytimesheet.com?start=11-1-2009&end=11-14-2009

But what daniel says, you could convert this in a post so you hide it altogether, if that is possible.

like image 1
Razzie Avatar answered Oct 18 '22 15:10

Razzie