Changeset 3055
- Timestamp:
- 06/01/06 23:20:32 (3 years ago)
- Files:
-
- django/trunk/django/conf/global_settings.py (modified) (1 diff)
- django/trunk/django/utils/translation.py (modified) (2 diffs)
- django/trunk/docs/settings.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/conf/global_settings.py
r3049 r3055 204 204 TIME_FORMAT = 'P' 205 205 206 # Default formatting for date objects when only the year and month are relevant. 207 # See all available format strings here: 208 # http://www.djangoproject.com/documentation/templates/#now 209 YEAR_MONTH_FORMAT = 'F Y' 210 211 # Default formatting for date objects when only the month and day are relevant. 212 # See all available format strings here: 213 # http://www.djangoproject.com/documentation/templates/#now 214 MONTH_DAY_FORMAT = 'F j' 215 206 216 # Whether to enable Psyco, which optimizes Python code. Requires Psyco. 207 217 # http://psyco.sourceforge.net/ django/trunk/django/utils/translation.py
r2927 r3055 222 222 True = right-to-left layout 223 223 """ 224 224 225 225 from django.conf import settings 226 226 return get_language() in settings.LANGUAGES_BIDI 227 227 228 228 def catalog(): 229 229 """ … … 370 370 if time_format == 'TIME_FORMAT': 371 371 time_format = settings.TIME_FORMAT 372 return (date_format, datetime_format, time_format) 372 return date_format, datetime_format, time_format 373 374 def get_partial_date_formats(): 375 """ 376 This function checks whether translation files provide a translation for some 377 technical message ID to store partial date formats. If it doesn't contain 378 one, the formats provided in the settings will be used. 379 """ 380 from django.conf import settings 381 year_month_format = _('YEAR_MONTH_FORMAT') 382 month_day_format = _('MONTH_DAY_FORMAT') 383 if year_month_format == 'YEAR_MONTH_FORMAT': 384 year_month_format = settings.YEAR_MONTH_FORMAT 385 if month_day_format == 'MONTH_DAY_FORMAT': 386 month_day_format = settings.MONTH_DAY_FORMAT 387 return year_month_format, month_day_format 373 388 374 389 def install(): django/trunk/docs/settings.txt
r3049 r3055 292 292 `allowed date format strings`_. 293 293 294 See also DATETIME_FORMAT and TIME_FORMAT.294 See also DATETIME_FORMAT, TIME_FORMAT, YEAR_MONTH_FORMAT and MONTH_DAY_FORMAT. 295 295 296 296 .. _allowed date format strings: http://www.djangoproject.com/documentation/templates/#now … … 305 305 `allowed date format strings`_. 306 306 307 See also DATE_FORMAT and TIME_FORMAT.307 See also DATE_FORMAT, DATETIME_FORMAT, TIME_FORMAT, YEAR_MONTH_FORMAT and MONTH_DAY_FORMAT. 308 308 309 309 .. _allowed date format strings: http://www.djangoproject.com/documentation/templates/#now … … 533 533 A tuple of middleware classes to use. See the `middleware docs`_. 534 534 535 MONTH_DAY_FORMAT 536 ---------------- 537 538 Default: ``'F j'`` 539 540 The default formatting to use for date fields on Django admin change-list 541 pages -- and, possibly, by other parts of the system -- in cases when only the 542 month and day are displayed. 543 544 For example, when a Django admin change-list page is being filtered by a date 545 drilldown, the header for a given day displays the day and month. Different 546 locales have different formats. For example, U.S. English would say 547 "January 1," whereas Spanish might say "1 Enero." 548 549 See `allowed date format strings`_. See also DATE_FORMAT, DATETIME_FORMAT, 550 TIME_FORMAT and YEAR_MONTH_FORMAT. 551 535 552 PREPEND_WWW 536 553 ----------- … … 697 714 `allowed date format strings`_. 698 715 699 See also DATE_FORMAT and DATETIME_FORMAT. 716 See also DATE_FORMAT, DATETIME_FORMAT, TIME_FORMAT, YEAR_MONTH_FORMAT and 717 MONTH_DAY_FORMAT. 700 718 701 719 .. _allowed date format strings: http://www.djangoproject.com/documentation/templates/#now … … 720 738 bandwidth but slows down performance. This is only used if ``CommonMiddleware`` 721 739 is installed (see the `middleware docs`_). 740 741 YEAR_MONTH_FORMAT 742 ----------------- 743 744 Default: ``'F Y'`` 745 746 The default formatting to use for date fields on Django admin change-list 747 pages -- and, possibly, by other parts of the system -- in cases when only the 748 year and month are displayed. 749 750 For example, when a Django admin change-list page is being filtered by a date 751 drilldown, the header for a given month displays the month and the year. 752 Different locales have different formats. For example, U.S. English would say 753 "January 2006," whereas another locale might say "2006/January." 754 755 See `allowed date format strings`_. See also DATE_FORMAT, DATETIME_FORMAT, 756 TIME_FORMAT and MONTH_DAY_FORMAT. 722 757 723 758 .. _cache docs: http://www.djangoproject.com/documentation/cache/
