ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > T-Clock

T-Clock 2010 (download)

<< < (91/171) > >>

henriko:
Hi Stoic Joker, and others. I'm not sure if there are going to be any more "official" builds from you, or if the project really is closed. But anyway. If someone will make a new build, here is a contribution to format.c , that will provide week numbers according to the ISO-8601 standard.

I hope that someone can make some use of it, and in that case document the feature where it should be documented. I have chosen Wi as the new format identifier for ISO-8601 week number.

It might be used like this:
vWi yymmdd hh:nn
v9 130217 12:14

format.c diff

--- ---535a536,613
> else if(*(sp + 1) == 'i') { // Week ISO-8601 (by henriko.se)
> int ISOWeek;
> struct tm *ptrtmLocalTime;
> struct tm tmCurrentTime;
> struct tm tmStartOfCurrentYear;
> ptrtmLocalTime = localtime(&ltime);
> tmCurrentTime = *ptrtmLocalTime;
> mktime(&tmCurrentTime);
> if(tmCurrentTime.tm_wday == 0)
> {
> tmCurrentTime.tm_wday = 7;
> }
> tmStartOfCurrentYear.tm_year = tmCurrentTime.tm_year;
> tmStartOfCurrentYear.tm_mon = 1 - 1;
> tmStartOfCurrentYear.tm_mday = 1;
> tmStartOfCurrentYear.tm_hour = 0;
> tmStartOfCurrentYear.tm_min = 0;
> tmStartOfCurrentYear.tm_sec = 0;
> tmStartOfCurrentYear.tm_isdst = 0;
> mktime(&tmStartOfCurrentYear);
> if(tmStartOfCurrentYear.tm_wday == 0)
> {
> tmStartOfCurrentYear.tm_wday = 7;
> }
> ISOWeek = (tmCurrentTime.tm_yday + (tmStartOfCurrentYear.tm_wday - 1)) / 7 + (tmStartOfCurrentYear.tm_wday <= 4 ? 1 : 0);
> if(ISOWeek == 0)
> {
> struct tm tmStartOfLastYear;
> struct tm tmEndOfLastYear;
> tmStartOfLastYear.tm_year = tmCurrentTime.tm_year - 1;
> tmStartOfLastYear.tm_mon = 1 - 1;
> tmStartOfLastYear.tm_mday = 1;
> tmStartOfLastYear.tm_hour = 0;
> tmStartOfLastYear.tm_min = 0;
> tmStartOfLastYear.tm_sec = 0;
> tmStartOfLastYear.tm_isdst = 0;
> mktime(&tmStartOfLastYear);
> if(tmStartOfLastYear.tm_wday == 0)
> {
> tmStartOfLastYear.tm_wday = 7;
> }
> tmEndOfLastYear.tm_year = tmCurrentTime.tm_year - 1;
> tmEndOfLastYear.tm_mon = 12 - 1;
> tmEndOfLastYear.tm_mday = 31;
> tmEndOfLastYear.tm_hour = 0;
> tmEndOfLastYear.tm_min = 0;
> tmEndOfLastYear.tm_sec = 0;
> tmEndOfLastYear.tm_isdst = 0;
> mktime(&tmEndOfLastYear);
> ISOWeek = (tmEndOfLastYear.tm_yday + (tmStartOfLastYear.tm_wday - 1)) / 7 + (tmStartOfLastYear.tm_wday <= 4 ? 1 : 0);
> }
> if(tmCurrentTime.tm_mon == 12 - 1 && tmCurrentTime.tm_mday >= 29) {
> if(tmCurrentTime.tm_wday <= 3)
> {
> struct tm tmStartOfNextYear;
> tmStartOfNextYear.tm_year = tmCurrentTime.tm_year + 1;
> tmStartOfNextYear.tm_mon = 1 - 1;
> tmStartOfNextYear.tm_mday = 1;
> tmStartOfNextYear.tm_hour = 0;
> tmStartOfNextYear.tm_min = 0;
> tmStartOfNextYear.tm_sec = 0;
> tmStartOfNextYear.tm_isdst = 0;
> mktime(&tmStartOfNextYear);
> if(tmStartOfNextYear.tm_wday == 0)
> {
> tmStartOfNextYear.tm_wday = 7;
> }
> if(tmStartOfNextYear.tm_wday <= 4)
> {
> ISOWeek = 1;
> }
> }
> }
> wsprintf(szWkNum, "%d", ISOWeek);
> Wk = szWkNum;
> while(*Wk) *dp++ = *Wk++;
> sp++;
> }

iflyun:
Hi, First off thanks for the great extension. I have a clear theme for windows 7 which doesn't darken the tray so i'm having a hard time reading the clock with white backgrounds. Is there a way to solve this problem? Changing the color of the text doesn't do anything and I'd prefer it to be white anyway.



Maybe something like subtitles on movies where the font is black and white?
or this Variable Text Color

Help? Just being able to change the color would be a start.

LonelyPixel:
Thank you Henrik for this patch. It was sitting in my inbox for a long time but I finally got around to apply it the build 98 and make a new build of it. I'm now testing it, which obviously may take a few days (and then some more years...). I've just put all three - Wi, Wm and Ww - in two rows to see when they differ.

In case anybody is interested, I've uploaded my build here:
http://unclassified.de/tmp/T-Clock.20130503.f9f71075.7z

It's basically the original build 98, upgraded for Visual Studio 2010, with the patch above applied. The archive contains all files from the Release directory that don't look like compiler stuff.

Stoic Joker:
Thanks to henriko for sharing a fix, and LonelyPixel for creating and sharing a build including the fix. I really still haven't even had time to fix my own copy... :-[

@LonelyPixel - If you like, I can add the link to your build to the first post so it's easier for people to find...else it might get lost back here on page 19. I'm still getting about 9 Emails a week about that bugg...So there's a huge calling for it.

LonelyPixel:
If you like, I can add the link to your build to the first post so it's easier for people to find...else it might get lost back here on page 19.
-Stoic Joker (May 03, 2013, 07:20 PM)
--- End quote ---

I have nothing against it, but this link is temporary so it may disappear some time in the future, either when it's replaced by a newer version or somebody else publishes a better one...

I'm not sure about your source code licence, I haven't found any information about it. I could put up a repository on Github and also upload current source builds there. That would be a more "suitable" location for such things. (I wouldn't want to setup a real project page on my dev website because it's not my project.) But I couldn't really maintain the code, just update it from other locations and integrate ready patches. How do you manage your source code? Could you work with a Github repository as well? (It could save you from data loss as well... :))

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version