Abstract Base Class for an annotation storage.
If the annotation wasn’t set, it won’t be created until the first attempt to set a property on this adapter. So, the context doesn’t get polluted with annotations by accident.
Return a Zope DateTime instance from a Python datetime instance.
Parameters: |
|
---|---|
Returns: | Zope DateTime |
Return type: | Zope DateTime |
Return a dictionary with dates in a given timeframe as keys and the actual occurrences for that date for building calendars. Long lasting events will occur on every day until their end.
Parameters: |
|
---|---|
Returns: | Dictionary with isoformat date strings as keys and event occurrences as values. |
Return type: | dict |
Return a dictionary with localized and readably formatted date parts.
Return a dictionary containing pre-calculated information for building <start>-<end> date strings.
The behavior os ulocalized_time() with time_only is odd. Setting time_only=False should return the date part only and not the time
>>> from DateTime import DateTime
>>> start = DateTime(2010,3,16,14,40)
>>> from zope.componen.hooks import getSite
>>> site = getSite()
>>> ulocalized_time(start, False, time_only=True, context=site)
u'14:40'
>>> ulocalized_time(start, False, time_only=False, context=site)
u'14:40'
>>> ulocalized_time(start, False, time_only=None, context=site)
u'16.03.2010'
Return the default end as python datetime for prefilling forms.
Returns: | Default end datetime. |
---|---|
Return type: | Python datetime |
Return the default start as python datetime for prefilling forms.
Returns: | Default start datetime. |
---|---|
Return type: | Python datetime |
Return the timezone from the portal or user.
Parameters: |
|
---|---|
Returns: | Timezone identifier or tzinfo object. |
Return type: | string or tzinfo object |
Returns a Python datetime instance set to the end time of the given day (23:59:59).
Parameters: | dt (Python datetime) – datetime to set to the end time of the day. |
---|---|
Returns: | datetime set to the end time of the day (23:59:59). |
Return type: | Python datetime |
Returns a Python datetime instance set to the start time of the given day (00:00:00).
Parameters: | dt (Python datetime) – datetime to set to the start time of the day. |
---|---|
Returns: | datetime set to the start time of the day (00:00:00). |
Return type: | Python datetime |
Find the next context with a given view name or interface, up in the content tree, starting from the given context. This might not be the IPloneSiteRoot, but another subsite.
Parameters: |
|
---|---|
Returns: | A context with the given view name, inteface or ISite root. |
Returns the number of the first Weekday in a Week, as defined in the registry. 0 is Monday, 6 is Sunday, as expected by Python’s datetime.
PLEASE NOTE: strftime %w interprets 0 as Sunday unlike the calendar module!
Returns: | Index of first weekday [0(Monday)..6(Sunday)] |
---|---|
Return type: | integer |
Return all events as catalog brains, possibly within a given timeframe.
Parameters: |
|
---|---|
Returns: | Portal events, matching the search criteria. |
Return type: | catalog brains |
Returns a timezone aware date object if an arbitrary ASCII string is formatted in an ISO date format, otherwise None is returned.
Used for traversing and Occurence ids.
Parameters: |
|
---|---|
Returns: | Localized date object. |
Return type: | Python date |
Return the current datetime localized to the default timezone.
Parameters: | context (Content object) – Context object. |
---|---|
Returns: | Localized current datetime. |
Return type: | Python datetime |
Return the current date localized to the default timezone.
Parameters: | context (Content object) – Context object. |
---|---|
Returns: | Localized current date. |
Return type: | Python date |
Return a start and end date from a given mode string, like “today”, “past” or “future”. This can be used in event retrieval functions.
Parameters: |
|
---|
Corrects for DateTime bugs doing wrong thing with timezones
Converts an integer weekday number to a representation where Monday is 0 and Sunday is 6 (the datetime default), from a representation where Sunday is 0, Monday is 1 and Saturday is 6 (the strftime behavior).
Parameters: | day (integer) – The weekday number [0(Sunday)..6] |
---|---|
Returns: | The weekday number [0(Monday)..6] |
Return type: | integer |
Converts an integer weekday number to a representation where Monday is 1, Saturday is 6 and Sunday is 0 (the strftime behavior), from a representation where Monday is 0 and Sunday is 6 (the datetime default).
Parameters: | day (integer) – The weekday number [0(Monday)..6] |
---|---|
Returns: | The weekday number [0(Sunday)..6] |
Return type: | integer |