Skip to content
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

Added cardinal and normal number options for seasons. #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added cardinal and normal number options for seasons. #10

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 30, 2014

No description provided.

@@ -285,6 +285,8 @@ void format(char *buf, const char* fmt, struct disc_time dt)
case 'a': wibble=day_short[dt.yday%5]; break;
case 'B': wibble=season_long[dt.season]; break;
case 'b': wibble=season_short[dt.season]; break;
case 'u': sprintf(snarf, "%u", dt.season+1); wibble=snarf; break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"%d" instead of "%u" as per cases 'd' and 'e'? Don't need unsigned integer in this case, do we?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jep, season is a signed int.

@cpjhenry
Copy link
Contributor

cpjhenry commented Sep 1, 2014

Should we add zero-padding option? (%z), so this: "%d/%u/%Y" produces: 25/04/3180 (for today's date).

@ghost
Copy link
Author

ghost commented Sep 1, 2014

Yes, zero padding would be really good idea.
Mimicking the functionality of date would probably be the best idea.

@bo0ts
Copy link
Owner

bo0ts commented Sep 8, 2014

Numbers instead of words for seasons! How ingenious. Please fix the format specifier to match the sign of the type and add zero padding if you like.

@danwdart
Copy link
Collaborator

Aha, this is exactly what I was doing just now.

I disagree that we need to zero pad anything that can't exceed nine though. That's the only reason that ISO does it, no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants