-
Notifications
You must be signed in to change notification settings - Fork 22
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
Idea: Suppress leading space for, e.g., "3:00pm" ? #8
Comments
It may be possible but would take some work. The issue is that strftime includes the space for single digit values with %l (for hour) and %e (for day of month). Stamp is simply inheriting the strftime behavior. |
What about %1I ?? that should suppress the leading space or 0. |
@tuker @mulder Nice, it looks like If you didn't catch it, this Bostonrb thread goes over it... http://groups.google.com/group/boston-rubygroup/browse_thread/thread/157927fdf102b93e/39b1b10aa3d3fbeb I'd love to update Stamp to use this (if available in whatever Ruby you're using) but haven't had a real issue with the leading space myself yet. Ultimately I'd like to decouple Stamp from strftime. |
Just incase anyone else needs this functionality right now and they don't know about squeeze, I've just been passing my formatted timestamps through it like |
With help from @kbrock, we've decoupled stamp from strftime, which eliminates the leading space behavior. This is currently on the rip-strftime branch, and I plan to merge to master and release a new version of the gem soon. |
I wonder if the leading space in the output could be suppressed for a format such as "3:00pm"?
ruby-1.9.2-p180 :003 > Time.now.stamp("3:00pm")
=> " 9:55am"
ruby-1.9.2-p180 :004 >
The text was updated successfully, but these errors were encountered: