-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Added some date and time formatting options to scrolling text effect. #4192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5960,10 +5960,16 @@ uint16_t mode_2Dscrollingtext(void) { | |
| else if (!strncmp_P(text,PSTR("#DDMM"),5)) sprintf_P(text, zero?PSTR("%02d.%02d") :PSTR("%d.%d"), day(localTime), month(localTime)); | ||
| else if (!strncmp_P(text,PSTR("#MMDD"),5)) sprintf_P(text, zero?PSTR("%02d/%02d") :PSTR("%d/%d"), month(localTime), day(localTime)); | ||
| else if (!strncmp_P(text,PSTR("#TIME"),5)) sprintf_P(text, zero?PSTR("%02d:%02d%s") :PSTR("%2d:%02d%s"), AmPmHour, minute(localTime), sec); | ||
| else if (!strncmp_P(text,PSTR("#HHMM"),5)) sprintf_P(text, zero?PSTR("%02d:%02d") :PSTR("%d:%02d"), AmPmHour, minute(localTime)); | ||
| else if (!strncmp_P(text,PSTR("#HH"),3)) sprintf_P(text, zero?PSTR("%02d") :PSTR("%d"), AmPmHour); | ||
| else if (!strncmp_P(text,PSTR("#MM"),3)) sprintf_P(text, zero?PSTR("%02d") :PSTR("%d"), minute(localTime)); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same problem here - changing the meaning of
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. This is an unacceptable change. |
||
| } | ||
| else if (!strncmp_P(text,PSTR("#hhmm"),5)) sprintf_P(text, zero?PSTR("%02d:%02d") :PSTR("%d:%02d"), AmPmHour, minute(localTime)); | ||
| else if (!strncmp_P(text,PSTR("#DD"),3)) sprintf_P(text, zero?PSTR("%02d") :PSTR("%d"), day(localTime)); | ||
| else if (!strncmp_P(text,PSTR("#MMM"),4)) sprintf_P(text, zero?PSTR("%s") :PSTR("%s"), monthShortStr(month(localTime))); | ||
| else if (!strncmp_P(text,PSTR("#MM"),3)) sprintf_P(text, zero?PSTR("%02d") :PSTR("%d"), month(localTime)); | ||
| else if (!strncmp_P(text,PSTR("#YYYY"),5)) sprintf_P(text, zero?PSTR("%04d") :PSTR("%d"), year(localTime)); | ||
| else if (!strncmp_P(text,PSTR("#YY"),3)) sprintf_P(text, zero?PSTR("%02d") :PSTR("%d"), year(localTime)-2000); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps a better way is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed on %100 way and keeping it backwards-compatible. I dont get the upper case part. |
||
| else if (!strncmp_P(text,PSTR("#hh"),3)) sprintf_P(text, zero?PSTR("%02d") :PSTR("%d"), AmPmHour); | ||
| else if (!strncmp_P(text,PSTR("#mm"),3)) sprintf_P(text, zero?PSTR("%02d") :PSTR("%d"), minute(localTime)); | ||
| else if (!strncmp_P(text,PSTR("#ss"),3)) sprintf_P(text, zero?PSTR("%s") :PSTR("%s"), &sec[1]); | ||
| } | ||
|
|
||
| const int numberOfLetters = strlen(text); | ||
| const unsigned long now = millis(); // reduce millis() calls | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove
#HHMMand#HH?Some user might have them in their preset. We should stay backwards-compatible.