コード例 #1
0
ファイル: plugin_man.py プロジェクト: ilius/starcal2
	def exportToIcs(self, fileName, startJd, endJd):
		currentTimeStamp = strftime(icsTmFormat)
		icsText = icsHeader
		for jd in range(startJd, endJd):
			isHoliday = False
			for mode in self.holidays.keys():
				myear, mmonth, mday = jd_to(jd, mode)
				if (mmonth, mday) in self.holidays[mode]:
					isHoliday = True
					break
			if isHoliday:
				gyear, gmonth, gday = jd_to(jd, DATE_GREG)
				gyear_next, gmonth_next, gday_next = jd_to(jd+1, DATE_GREG)
				#######
				icsText += 'BEGIN:VEVENT\n'
				icsText += 'CREATED:%s\n'%currentTimeStamp
				icsText += 'LAST-MODIFIED:%s\n'%currentTimeStamp
				icsText += 'DTSTART;VALUE=DATE:%.4d%.2d%.2d\n'%(gyear, gmonth, gday)
				icsText += 'DTEND;VALUE=DATE:%.4d%.2d%.2d\n'%(gyear_next, gmonth_next, gday_next)
				icsText += 'CATEGORIES:Holidays\n'
				icsText += 'TRANSP:TRANSPARENT\n'
				## TRANSPARENT because being in holiday time, does not make you busy!
				## see http://www.kanzaki.com/docs/ical/transp.html
				icsText += 'SUMMARY:%s\n'%_('Holiday')
				icsText += 'END:VEVENT\n'
		icsText += 'END:VCALENDAR\n'
		open(fileName, 'w').write(icsText)
コード例 #2
0
ファイル: git.py プロジェクト: ErfanBagheri/starcal
def getCommitList(obj, startJd=None, endJd=None):
    '''
        returns a list of (epoch, commit_id) tuples
    '''
    cmd = [
        'git',
        '--git-dir', join(obj.vcsDir, '.git'),
        'log',
        '--pretty=format:%ct %H',
    ]
    if startJd is not None:
        cmd += [
            '--since',
            dateEncode(jd_to(startJd, DATE_GREG)),
        ]
    if endJd is not None:
        cmd += [
            '--until',
            dateEncode(jd_to(endJd, DATE_GREG)),
        ]
    p = Popen(cmd, stdout=PIPE)
    p.wait()
    data = []
    for line in p.stdout:
        parts = line.strip().split(' ')
        data.append((
            int(parts[0]),
            parts[1],
        ))
    return data
コード例 #3
0
ファイル: plugin_man.py プロジェクト: amirkarimi/starcal
 def exportToIcs(self, fileName, startJd, endJd):
     currentTimeStamp = strftime(icsTmFormat)
     icsText = icsHeader
     for jd in range(startJd, endJd):
         isHoliday = False
         for mode in self.holidays.keys():
             myear, mmonth, mday = jd_to(jd, mode)
             if (mmonth, mday) in self.holidays[mode]:
                 isHoliday = True
                 break
         if isHoliday:
             gyear, gmonth, gday = jd_to(jd, DATE_GREG)
             gyear_next, gmonth_next, gday_next = jd_to(jd+1, DATE_GREG)
             #######
             icsText += 'BEGIN:VEVENT\n'
             icsText += 'CREATED:%s\n'%currentTimeStamp
             icsText += 'LAST-MODIFIED:%s\n'%currentTimeStamp
             icsText += 'DTSTART;VALUE=DATE:%.4d%.2d%.2d\n'%(gyear, gmonth, gday)
             icsText += 'DTEND;VALUE=DATE:%.4d%.2d%.2d\n'%(gyear_next, gmonth_next, gday_next)
             icsText += 'CATEGORIES:Holidays\n'
             icsText += 'TRANSP:TRANSPARENT\n'
             ## TRANSPARENT because being in holiday time, does not make you busy!
             ## see http://www.kanzaki.com/docs/ical/transp.html
             icsText += 'SUMMARY:%s\n'%_('Holiday')
             icsText += 'END:VEVENT\n'
     icsText += 'END:VCALENDAR\n'
     open(fileName, 'w').write(icsText)
コード例 #4
0
ファイル: ics.py プロジェクト: Noori/starcal
def convertHolidayPlugToIcs(plug, startJd, endJd, namePostfix=''):
    icsText = icsHeader
    currentTimeStamp = strftime(icsTmFormat)
    for jd in range(startJd, endJd):
        isHoliday = False
        for mode in plug.holidays.keys():
            myear, mmonth, mday = jd_to(jd, mode)
            if (mmonth, mday) in plug.holidays[mode]:
                isHoliday = True
                break
        if isHoliday:
            gyear, gmonth, gday = jd_to(jd, DATE_GREG)
            gyear_next, gmonth_next, gday_next = jd_to(jd+1, DATE_GREG)
            #######
            icsText += 'BEGIN:VEVENT\n'
            icsText += 'CREATED:%s\n'%currentTimeStamp
            icsText += 'LAST-MODIFIED:%s\n'%currentTimeStamp
            icsText += 'DTSTART;VALUE=DATE:%.4d%.2d%.2d\n'%(gyear, gmonth, gday)
            icsText += 'DTEND;VALUE=DATE:%.4d%.2d%.2d\n'%(gyear_next, gmonth_next, gday_next)
            icsText += 'CATEGORIES:Holidays\n'
            icsText += 'TRANSP:TRANSPARENT\n'
            ## TRANSPARENT because being in holiday time, does not make you busy!
            ## see http://www.kanzaki.com/docs/ical/transp.html
            icsText += 'SUMMARY:%s\n'%_('Holiday')
            icsText += 'END:VEVENT\n'
    icsText += 'END:VCALENDAR\n'
    fname = split(plug.path)[-1]
    fname = splitext(fname)[0] + '%s.ics'%namePostfix
    open(fname, 'w').write(icsText)
コード例 #5
0
def convertHolidayPlugToIcs(plug, startJd, endJd, namePostfix=''):
	icsText = icsHeader
	currentTimeStamp = strftime(icsTmFormat)
	for jd in range(startJd, endJd):
		isHoliday = False
		for mode in plug.holidays.keys():
			myear, mmonth, mday = jd_to(jd, mode)
			if (mmonth, mday) in plug.holidays[mode]:
				isHoliday = True
				break
		if isHoliday:
			gyear, gmonth, gday = jd_to(jd, DATE_GREG)
			gyear_next, gmonth_next, gday_next = jd_to(jd+1, DATE_GREG)
			#######
			icsText += 'BEGIN:VEVENT\n'
			icsText += 'CREATED:%s\n'%currentTimeStamp
			icsText += 'LAST-MODIFIED:%s\n'%currentTimeStamp
			icsText += 'DTSTART;VALUE=DATE:%.4d%.2d%.2d\n'%(gyear, gmonth, gday)
			icsText += 'DTEND;VALUE=DATE:%.4d%.2d%.2d\n'%(gyear_next, gmonth_next, gday_next)
			icsText += 'CATEGORIES:Holidays\n'
			icsText += 'TRANSP:TRANSPARENT\n'
			## TRANSPARENT because being in holiday time, does not make you busy!
			## see http://www.kanzaki.com/docs/ical/transp.html
			icsText += 'SUMMARY:%s\n'%_('Holiday')
			icsText += 'END:VEVENT\n'
	icsText += 'END:VCALENDAR\n'
	fname = split(plug.path)[-1]
	fname = splitext(fname)[0] + '%s.ics'%namePostfix
	open(fname, 'w').write(icsText)
コード例 #6
0
 def updateWidget(self):  ## FIXME
     common.WidgetClass.updateWidget(self)
     mode = self.event.mode
     ###
     self.startDateInput.set_value(jd_to(self.event.getStartJd(), mode))
     self.weeksSpin.set_value(self.event['cycleWeeks'].weeks)
     self.endDateInput.set_value(jd_to(self.event.getEndJd(), mode))
     ###
     timeRangeRule = self.event['dayTimeRange']
     self.dayTimeStartInput.set_value(timeRangeRule.dayTimeStart)
     self.dayTimeEndInput.set_value(timeRangeRule.dayTimeEnd)
コード例 #7
0
ファイル: weekly.py プロジェクト: amirkarimi/starcal
 def updateWidget(self):## FIXME
     common.WidgetClass.updateWidget(self)
     mode = self.event.mode
     ###
     self.startDateInput.set_value(jd_to(self.event.getStartJd(), mode))
     self.weeksSpin.set_value(self.event['cycleWeeks'].weeks)
     self.endDateInput.set_value(jd_to(self.event.getEndJd(), mode))
     ###
     timeRangeRule = self.event['dayTimeRange']
     self.dayTimeStartInput.set_value(timeRangeRule.dayTimeStart)
     self.dayTimeEndInput.set_value(timeRangeRule.dayTimeEnd)
コード例 #8
0
 def updateWidget(self):
     #for index, module in calTypes.iterIndexModule():
     #	if module.name != 'hijri':
     for mode in calTypes.active:
         modeDesc = calTypes[mode].desc
         if not 'hijri' in modeDesc.lower():
             self.altMode = mode
             self.altModeDesc = modeDesc
             break
     self.topLabel.set_label(
         _('Start') + ': ' + dateLocale(*monthDb.startDate) + ' ' +
         _('Equals to') + ' %s' % _(self.altModeDesc))
     self.startDateInput.set_value(jd_to(monthDb.startJd, self.altMode))
     ###########
     selectYm = getCurrentYm() - 1  ## previous month
     selectIndex = None
     self.trees.clear()
     for index, ym, mLen in monthDb.getMonthLenList():
         if ym == selectYm:
             selectIndex = index
         year, month0 = divmod(ym, 12)
         self.trees.append([
             ym,
             _(year),
             _(monthName[month0]),
             mLen,
             '',
         ])
     self.updateEndDates()
     ########
     if selectIndex is not None:
         self.treev.scroll_to_cell(str(selectIndex))
         self.treev.set_cursor(str(selectIndex))
コード例 #9
0
 def updateEndDates(self):
     y, m, d = self.startDateInput.get_value()
     jd0 = to_jd(y, m, d, self.altMode) - 1
     for row in self.trees:
         mLen = row[3]
         jd0 += mLen
         row[4] = dateLocale(*jd_to(jd0, self.altMode))
コード例 #10
0
ファイル: hijri.py プロジェクト: amirkarimi/starcal
 def updateWidget(self):
     # for index, module in calTypes.iterIndexModule():
     #    if module.name != 'hijri':
     for mode in calTypes.active:
         modeDesc = calTypes[mode].desc
         if not "hijri" in modeDesc.lower():
             self.altMode = mode
             self.altModeDesc = modeDesc
             break
     self.topLabel.set_label(
         _("Start") + ": " + dateLocale(*monthDb.startDate) + " " + _("Equals to") + " %s" % _(self.altModeDesc)
     )
     self.startDateInput.set_value(jd_to(monthDb.startJd, self.altMode))
     ###########
     selectYm = getCurrentYm() - 1  ## previous month
     selectIndex = None
     self.trees.clear()
     for index, ym, mLen in monthDb.getMonthLenList():
         if ym == selectYm:
             selectIndex = index
         year, month0 = divmod(ym, 12)
         self.trees.append([ym, _(year), _(monthName[month0]), mLen, ""])
     self.updateEndDates()
     ########
     if selectIndex is not None:
         self.treev.scroll_to_cell(str(selectIndex))
         self.treev.set_cursor(str(selectIndex))
コード例 #11
0
ファイル: hijri.py プロジェクト: amirkarimi/starcal
 def updateEndDates(self):
     y, m, d = self.startDateInput.get_value()
     jd0 = to_jd(y, m, d, self.altMode) - 1
     for row in self.trees:
         mLen = row[3]
         jd0 += mLen
         row[4] = dateLocale(*jd_to(jd0, self.altMode))
コード例 #12
0
ファイル: allDayTask.py プロジェクト: ErfanBagheri/starcal
 def updateWidget(self):## FIXME
     common.EventWidget.updateWidget(self)
     mode = self.event.mode
     ###
     startJd = self.event.getJd()
     self.startDateInput.set_value(jd_to(startJd, mode))
     ###
     endType, endValue = self.event.getEnd()
     if endType=='duration':
         self.endTypeCombo.set_active(0)
         self.durationSpin.set_value(endValue)
         self.endDateInput.set_value(jd_to(self.event.getEndJd(), mode))## FIXME
     elif endType=='date':
         self.endTypeCombo.set_active(1)
         self.endDateInput.set_value(endValue)
     else:
         raise RuntimeError
     self.endTypeComboChanged()
コード例 #13
0
ファイル: core.py プロジェクト: Noori/starcal
def ymdRange(date1, date2, mode=None):
    y1, m1, d1 = date1
    y2, m2, d2 = date2
    if y1==y2 and m1==m2:
        for d in range(d1, d2):
            yield y1, m1, d
    if mode==None:
        mode = DATE_GREG
    j1 = int(to_jd(y1, m1, d1, mode))
    j2 = int(to_jd(y2, m2, d2, mode))
    for j in range(j1, j2):
        yield jd_to(j, mode)
コード例 #14
0
ファイル: plugin_man.py プロジェクト: ilius/starcal2
	def exportToIcs(self, fileName, startJd, endJd):
		currentTimeStamp = strftime(icsTmFormat)
		self.load() ## FIXME
		mode = self.mode
		icsText = icsHeader
		for jd in range(startJd, endJd):
			myear, mmonth, mday = jd_to(jd, mode)
			dayText = self.get_text(myear, mmonth, mday)
			if dayText:
				gyear, gmonth, gday = jd_to(jd, DATE_GREG)
				gyear_next, gmonth_next, gday_next = jd_to(jd+1, DATE_GREG)
				#######
				icsText += 'BEGIN:VEVENT\n'
				icsText += 'CREATED:%s\n'%currentTimeStamp
				icsText += 'LAST-MODIFIED:%s\n'%currentTimeStamp
				icsText += 'DTSTART;VALUE=DATE:%.4d%.2d%.2d\n'%(gyear, gmonth, gday)
				icsText += 'DTEND;VALUE=DATE:%.4d%.2d%.2d\n'%(gyear_next, gmonth_next, gday_next)
				icsText += 'SUMMARY:%s\n'%dayText
				icsText += 'END:VEVENT\n'
		icsText += 'END:VCALENDAR\n'
		open(fileName, 'w').write(icsText)
コード例 #15
0
ファイル: plugin_man.py プロジェクト: amirkarimi/starcal
 def exportToIcs(self, fileName, startJd, endJd):
     currentTimeStamp = strftime(icsTmFormat)
     self.load() ## FIXME
     mode = self.mode
     icsText = icsHeader
     for jd in range(startJd, endJd):
         myear, mmonth, mday = jd_to(jd, mode)
         dayText = self.get_text(myear, mmonth, mday)
         if dayText:
             gyear, gmonth, gday = jd_to(jd, DATE_GREG)
             gyear_next, gmonth_next, gday_next = jd_to(jd+1, DATE_GREG)
             #######
             icsText += 'BEGIN:VEVENT\n'
             icsText += 'CREATED:%s\n'%currentTimeStamp
             icsText += 'LAST-MODIFIED:%s\n'%currentTimeStamp
             icsText += 'DTSTART;VALUE=DATE:%.4d%.2d%.2d\n'%(gyear, gmonth, gday)
             icsText += 'DTEND;VALUE=DATE:%.4d%.2d%.2d\n'%(gyear_next, gmonth_next, gday_next)
             icsText += 'SUMMARY:%s\n'%dayText
             icsText += 'END:VEVENT\n'
     icsText += 'END:VCALENDAR\n'
     open(fileName, 'w').write(icsText)
コード例 #16
0
ファイル: ics.py プロジェクト: Noori/starcal
def convertBuiltinTextPlugToIcs(plug, startJd, endJd, namePostfix=''):
    plug.load() ## FIXME
    mode = plug.mode
    icsText = icsHeader
    currentTimeStamp = strftime(icsTmFormat)
    for jd in range(startJd, endJd):
        myear, mmonth, mday = jd_to(jd, mode)
        dayText = plug.get_text(myear, mmonth, mday)
        if dayText:
            gyear, gmonth, gday = jd_to(jd, DATE_GREG)
            gyear_next, gmonth_next, gday_next = jd_to(jd+1, DATE_GREG)
            #######
            icsText += 'BEGIN:VEVENT\n'
            icsText += 'CREATED:%s\n'%currentTimeStamp
            icsText += 'LAST-MODIFIED:%s\n'%currentTimeStamp
            icsText += 'DTSTART;VALUE=DATE:%.4d%.2d%.2d\n'%(gyear, gmonth, gday)
            icsText += 'DTEND;VALUE=DATE:%.4d%.2d%.2d\n'%(gyear_next, gmonth_next, gday_next)
            icsText += 'SUMMARY:%s\n'%dayText
            icsText += 'END:VEVENT\n'
    icsText += 'END:VCALENDAR\n'
    fname = split(plug.path)[-1]
    fname = splitext(fname)[0] + '%s.ics'%namePostfix
    open(fname, 'w').write(icsText)
コード例 #17
0
ファイル: plugin_man.py プロジェクト: amirkarimi/starcal
 def update_cell(self, c):
     if not c.holiday:
         for mode in self.holidays:
             y, m, d = c.dates[mode]
             for hm, hd in self.holidays[mode]:
                 if m==hm:
                     if d==hd:
                         c.holiday = True
                         break
                     elif self.last_day_merge and d==hd-1 and hd>=calTypes[mode].minMonthLen:
                         ny, nm, nd = jd_to(c.jd+1, mode)
                         if (ny, nm) > (y, m):
                             c.holiday = True
                             break
コード例 #18
0
ファイル: plugin_man.py プロジェクト: ilius/starcal2
	def update_cell(self, c):
		if not c.holiday:
			for mode in self.holidays:
				y, m, d = c.dates[mode]
				for hm, hd in self.holidays[mode]:
					if m==hm:
						if d==hd:
							c.holiday = True
							break
						elif self.last_day_merge and d==hd-1 and hd>=calTypes[mode].minMonthLen:
							ny, nm, nd = jd_to(c.jd+1, mode)
							if (ny, nm) > (y, m):
								c.holiday = True
								break
コード例 #19
0
def convertBuiltinTextPlugToIcs(plug, startJd, endJd, namePostfix=''):
	plug.load() ## FIXME
	mode = plug.mode
	icsText = icsHeader
	currentTimeStamp = strftime(icsTmFormat)
	for jd in range(startJd, endJd):
		myear, mmonth, mday = jd_to(jd, mode)
		dayText = plug.get_text(myear, mmonth, mday)
		if dayText:
			gyear, gmonth, gday = jd_to(jd, DATE_GREG)
			gyear_next, gmonth_next, gday_next = jd_to(jd+1, DATE_GREG)
			#######
			icsText += 'BEGIN:VEVENT\n'
			icsText += 'CREATED:%s\n'%currentTimeStamp
			icsText += 'LAST-MODIFIED:%s\n'%currentTimeStamp
			icsText += 'DTSTART;VALUE=DATE:%.4d%.2d%.2d\n'%(gyear, gmonth, gday)
			icsText += 'DTEND;VALUE=DATE:%.4d%.2d%.2d\n'%(gyear_next, gmonth_next, gday_next)
			icsText += 'SUMMARY:%s\n'%dayText
			icsText += 'END:VEVENT\n'
	icsText += 'END:VCALENDAR\n'
	fname = split(plug.path)[-1]
	fname = splitext(fname)[0] + '%s.ics'%namePostfix
	open(fname, 'w').write(icsText)
コード例 #20
0
ファイル: plugin_man.py プロジェクト: ilius/starcal2
	def update_cell(self, c):
		y, m, d = c.dates[self.mode]
		text = ''
		t = self.get_text(y, m, d)
		if t:
			text += t
		if self.last_day_merge and d>=calTypes[self.mode].minMonthLen:
		## and d<=calTypes[self.mode].maxMonthLen:
			ny, nm, nd = jd_to(c.jd + 1, self.mode)
			if nm > m or ny > y:
				nt = self.get_text(y, m, d+1)
				if nt:
					text += nt
		if text:
			if c.pluginsText:
				c.pluginsText += '\n'
			c.pluginsText += text
コード例 #21
0
ファイル: plugin_man.py プロジェクト: amirkarimi/starcal
 def update_cell(self, c):
     y, m, d = c.dates[self.mode]
     text = ''
     t = self.get_text(y, m, d)
     if t:
         text += t
     if self.last_day_merge and d>=calTypes[self.mode].minMonthLen:
     ## and d<=calTypes[self.mode].maxMonthLen:
         ny, nm, nd = jd_to(c.jd + 1, self.mode)
         if nm > m or ny > y:
             nt = self.get_text(y, m, d+1)
             if nt:
                 text += nt
     if text:
         if c.pluginsText:
             c.pluginsText += '\n'
         c.pluginsText += text
コード例 #22
0
class DateButton(MultiSpinButton):
    def __init__(self, date=None, **kwargs):
        MultiSpinButton.__init__(self, '/', (
            YearField(),
            MonthField(),
            DayField(),
        ), **kwargs)
        if date == None:
            date = localtime()[:3]
        self.set_value(date)

    def get_jd(self, mode):
        y, m, d = self.get_value()
        return to_jd(y, m, d, mode)

    changeMode = lambda self, fromMode, toMode: self.set_value(
        jd_to(self.get_jd(fromMode), toMode))

    def setMaxDay(self, _max):
        self.field.children[2].setMax(_max)
        self.update()
コード例 #23
0
ファイル: ui.py プロジェクト: amirkarimi/starcal
 def __init__(self, jd):
     self.eventsData = []
     #self.eventsDataIsSet = False ## not used
     self.pluginsText = ''
     ###
     self.jd = jd
     date = core.jd_to_primary(jd)
     self.year, self.month, self.day = date
     self.weekDay = core.jwday(jd)
     self.weekNum = core.getWeekNumber(self.year, self.month, self.day)
     #self.weekNumNeg = self.weekNum + 1 - core.getYearWeeksCount(self.year)
     self.weekNumNeg = self.weekNum - int(calTypes.primaryModule().avgYearLen / 7)
     self.holiday = (self.weekDay in core.holidayWeekDays)
     ###################
     self.dates = [
         date if mode==calTypes.primary else jd_to(jd, mode)
         for mode in range(len(calTypes))
     ]
     '''
     self.dates = dict([
         (
             mode, date if mode==calTypes.primary else jd_to(jd, mode)
         )
         for mode in calTypes.active
     ])
     '''
     ###################
     for k in core.plugIndex:
         plug = core.allPlugList[k]
         if plug.enable:
             try:
                 plug.update_cell(self)
             except:
                 myRaiseTback()
     ###################
     #t0 = now()
     self.eventsData = event_lib.getDayOccurrenceData(jd, eventGroups)## here? FIXME
コード例 #24
0
ファイル: ics.py プロジェクト: Noori/starcal
def getIcsDateByJd(jd, pretty=False):
    y, m, d = jd_to(jd, DATE_GREG)
    return getIcsDate(y, m, d, pretty)
コード例 #25
0
ファイル: core.py プロジェクト: seacgroup/starcal
def floatJdEncode(jd, mode):
    jd, hour, minute, second = getJhmsFromEpoch(getEpochFromJd(jd))
    return dateEncode(jd_to(jd, mode)) + ' ' + timeEncode((hour, minute, second))
コード例 #26
0
ファイル: core.py プロジェクト: seacgroup/starcal
def getMonthWeekNth(jd, mode):
    year, month, day = jd_to(jd, mode)
    absWeekNumber, weekDay = getWeekDateFromJd(jd)
    ##
    dayDiv, dayMode = divmod(day-1, 7)
    return month, dayDiv, weekDay
コード例 #27
0
ファイル: core.py プロジェクト: seacgroup/starcal
def restart():## will not return from function
    os.environ['LANG'] = locale_man.sysLangDefault
    restartLow()

#########################################################

def ymdRange((y1, m1, d1), (y2, m2, d2), mode=None):
    if y1==y2 and m1==m2:
        for d in range(d1, d2):
            yield y1, m1, d
    if mode==None:
        mode = DATE_GREG
    j1 = int(to_jd(y1, m1, d1, mode))
    j2 = int(to_jd(y2, m2, d2, mode))
    for j in range(j1, j2):
        yield jd_to(j, mode)

def getSysDate(mode=None):
    if mode is None:
        mode = primaryMode
    if mode==DATE_GREG:
        return localtime()[:3]
    else:
        gy, gm, gd = localtime()[:3]
        return convert(gy, gm, gd, DATE_GREG, mode)

def mylocaltime(sec=None, mode=None):
    if mode==None:##DATE_GREG
        return list(localtime(sec))
    t = list(localtime(sec))
    t[:3] = convert(t[0], t[1], t[2], DATE_GREG, mode)
コード例 #28
0
def getIcsDateByJd(jd, pretty=False):
	y, m, d = jd_to(jd, DATE_GREG)
	return getIcsDate(y, m, d, pretty)