开发者

How to generate calendar? [closed]

开发者 https://www.devze.com 2023-04-04 00:59 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

How to generate calendar based on datetime viariable view in template like this?

<< Jan               Mar >>
Sun Mon Tue Wed Thu Fri Sat
    开发者_StackOverflow社区      1   2   3   4   5
  6   7   8   9  10  11  12
 13  14  15  16  17  18  19
 20  21  22  23  24  25  26
 27  28  29  30  31

in tables/div whatever...


simple django event calendar


You might find the stdlib module calendar helpful:

>>> calendar.monthcalendar(2011, 9)
[[ 0,  0,  0,  1,  2,  3,  4], 
 [ 5,  6,  7,  8,  9, 10, 11], 
 [12, 13, 14, 15, 16, 17, 18], 
 [19, 20, 21, 22, 23, 24, 25], 
 [26, 27, 28, 29, 30,  0,  0]]

(with whitespace added to show structure)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号