Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
icalendar.prop.vDate Class Reference

List of all members.

Public Member Functions

def __init__
def ical
def from_ical
def __str__

Public Attributes

 dt
 params

Static Public Attributes

tuple from_ical = staticmethod(from_ical)

Detailed Description

Render and generates iCalendar date format.
>>> d = date(2001, 1,1)
>>> vDate(d).ical()
'20010101'

>>> vDate.from_ical('20010102')
datetime.date(2001, 1, 2)

>>> vDate('d').ical()
Traceback (most recent call last):
    ...
ValueError: Value MUST be a date instance

Definition at line 333 of file prop.py.


Constructor & Destructor Documentation

def icalendar.prop.vDate.__init__ (   self,
  dt 
)

Definition at line 349 of file prop.py.

00349 
00350     def __init__(self, dt):
00351         if not isinstance(dt, date):
00352             raise ValueError('Value MUST be a date instance')
00353         self.dt = dt
00354         self.params = Parameters()


Member Function Documentation

Definition at line 371 of file prop.py.

00371 
00372     def __str__(self):
00373         return self.ical()
00374 
00375 

Here is the call graph for this function:

Definition at line 358 of file prop.py.

00358 
00359     def from_ical(ical):
00360         "Parses the data format from ical text format"
00361         try:
00362             timetuple = map(int, ((
00363                 ical[:4],     # year
00364                 ical[4:6],    # month
00365                 ical[6:8],    # day
00366                 )))
00367             return date(*timetuple)
00368         except:
            raise ValueError, 'Wrong date format %s' % ical
def icalendar.prop.vDate.ical (   self)

Definition at line 355 of file prop.py.

00355 
00356     def ical(self):
00357         return self.dt.strftime("%Y%m%d")

Here is the caller graph for this function:


Member Data Documentation

Definition at line 352 of file prop.py.

tuple icalendar.prop.vDate.from_ical = staticmethod(from_ical) [static]

Definition at line 369 of file prop.py.

Definition at line 353 of file prop.py.


The documentation for this class was generated from the following file: