diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | DDate.vala | 4 | ||||
-rw-r--r-- | DDateTest.vala | 7 | ||||
-rw-r--r-- | Makefile | 6 |
4 files changed, 15 insertions, 3 deletions
@@ -1,2 +1,3 @@ *~ DClock +DDateTest @@ -66,14 +66,14 @@ public struct DDate { } public uchar get_day() { - return (uchar)(get_day_of_year() % 73); + return (uchar)(((get_day_of_year()-1) % 73) + 1); } public DDateMonth get_month() { if(is_st_tibs_day()) return DDateMonth.ST_TIBS_DAY; - return (DDateMonth)(get_day_of_year()/73); + return (DDateMonth)((get_day_of_year()-1)/73); } public DDateWeekday get_weekday() { diff --git a/DDateTest.vala b/DDateTest.vala new file mode 100644 index 0000000..487aed7 --- /dev/null +++ b/DDateTest.vala @@ -0,0 +1,7 @@ +void main() { + Date date = Date(); + date.set_dmy(15,3,2010); + DDate ddate = DDate(date); + + print(ddate.to_string() + "\n"); +} @@ -1,7 +1,11 @@ -all : DClock +all : DClock DDateTest DClock : DClock.vala DDate.vala valac --pkg=libpanelapplet-2.0 DClock.vala DDate.vala +DDateTest : DDateTest.vala DDate.vala + valac DDateTest.vala DDate.vala + + clean : rm -f DClock |