日期范围的URL约定 [英] URL convention for date range

查看:63
本文介绍了日期范围的URL约定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在友好的URL中显示日期范围的惯例是什么?

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

例如,在时间跟踪应用程序中。我想使用更容易区分用户的东西,而不是在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.

推荐答案

您是否考虑过ISO格式的日期,尤其是其紧凑格式的 YYYYMMDD ,那么它应该可能具有以下条件:

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.

编辑:这也与路由有关...

this is about routing as well...

这篇关于日期范围的URL约定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆