diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2010-06-03 03:13:37 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2010-06-03 03:13:37 +0200 |
commit | 61eb83337daac43e6c048549c0300bdde7af158a (patch) | |
tree | 464628e339f43ddfce6a27fc1722e225e814cb01 | |
parent | 39e513b0f0d03e0886ef2f201fc3d9e1e6186f8b (diff) | |
download | dclock-master.tar dclock-master.zip |
-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 |