- <div id="lcd">
- <h1><script type="text/javascript">with (Cycript.all) {
- var locale = CFLocaleCopyCurrent();
- var formatter = CFDateFormatterCreate(NULL, locale, kCFDateFormatterNoStyle, kCFDateFormatterNoStyle);
- CFRelease(locale);
- var format = UIDateFormatStringForFormatType(UINoAMPMTimeFormat);
- CFDateFormatterSetFormat(formatter, format);
- var now = CFDateCreate(NULL, CFAbsoluteTimeGetCurrent());
- var string = CFDateFormatterCreateStringWithDate(NULL, formatter, now);
- CFRelease(formatter);
- document.write(string);
- CFRelease(string);
- }</script></h1>
+ <!-- XXX: extract this out to some kind of nifty Lock Cydget library -->
+ <div id="lcd"><script type="text/javascript">with (Cycript.all) {
+ var locale = CFLocaleCopyCurrent();
+ var now = CFDateCreate(NULL, CFAbsoluteTimeGetCurrent());
+ var formatter = CFDateFormatterCreate(NULL, locale, kCFDateFormatterNoStyle, kCFDateFormatterNoStyle);
+ CFRelease(locale);
+
+ CFDateFormatterSetFormat(formatter, UIDateFormatStringForFormatType(UINoAMPMTimeFormat));
+ var time = CFDateFormatterCreateStringWithDate(NULL, formatter, now);
+ document.write('<h1>' + time + '</h1>');
+ CFRelease(time);
+
+ CFDateFormatterSetFormat(formatter, UIDateFormatStringForFormatType(UIWeekdayNoYearDateFormat));
+ var date = CFDateFormatterCreateStringWithDate(NULL, formatter, now);
+ document.write('<h2>' + date + '</h2>');
+ CFRelease(date);