There are many places where MERCI lacks in internationalization/localization. #462762: Make date field internationally compatible would be an important one (hint, hint...).
Having an option to use standard 24-hour time rather than the "quirky" am/pm format in the cool graph would be another.
I might be willing to contribute some work in that area, but I'm unsure where MERCI stands and whether there's interest. 1.x-dev seems to be dysfunctional (like Reservation Template in 1.0, see #648278: Scheduling repeating reservations)...
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | misformatted_merci.png | 40.8 KB | kreynen |
| #23 | wellformatted_merci.png | 36.81 KB | kreynen |
| #17 | merci.module.rej_.txt | 1.49 KB | kreynen |
| #9 | merci.648786.9.patch | 5.83 KB | salvis |
| #5 | merci.648786.5.patch | 5.7 KB | salvis |
Comments
Comment #1
kreynen commentedI know I committed to using the site's default date format at install, I couldn't locate that variable. Granted I only looked for 15 minutes.
Like I've said before... I'm open to committing any patches that make MERCI more useful for users outside the US, but I don't have time to work on that. There are a number of features the public access stations we've partnered with want. Unfortunately, internalization isn't one of them :(
Bring on the patches!
Comment #2
salvisThank you for your reassurance.
I can't use 1.x-dev and opened a dedicated issue: #649530: Creating the cool graph hangs until PHP times out
Should I post patches against 1.0?
Comment #3
kreynen commentedThe WSOD issue has been resolved. Posting small patches often will help get those changes into updates more quickly.
Comment #4
salvisThanks, I will.
It's not at the top of my list right now, but I have a definite need for it.
What's your preference: make a separate am/pm vs. 24-hour time setting or take it from the default site setting like #462762: Make date field internationally compatible?
Comment #5
salvisHere's a patch that fixes a few things:
P.S. I've tried to mimic your chaotic indentation and tab use...
Comment #6
salvisComment #7
kreynen commentedI've tried to mimic your chaotic indentation and tab use
Sorry. I (stupidly) assumed based on the feedback from #661204 you were working from a version with the 2 space tabs. I cleaned up the module formatting to make Coder happier before I looked at this patch.
Rather than roll back and forth, any chance I could get you to recreate it based on the latest commit?
Comment #8
salvisSure, no problem. Having the code cleaned up is definitely worth it for me to reroll.
I'll integrate the new functionality (such as merci_hours_admin), too...
Comment #9
salvisHere's the rerolled patch. See the comments in #5.
Comment #10
kreynen commentedSorry for the delay in looking at this patch. Hectic holidays. Patch applied without any errors to the current dev commit. Didn't get any errors with my basic tests, but it would be great if other MERCI users could test with their configurations... especially users who aren't using mm/dd/yyyy date formats (basically the rest of the world).
This is a great issue for non-developers to help with. The more non-developers do to help with testing, documentation, and support the more time developers have to develop.
Make moving from open source 'user' to contributor your 2010 resolution!
Comment #11
salvisThanks for looking into it!
I understand your wishful thinking, but this is not going to happen. The number of known installed sites of my combined contribs is about 200 times the number of MERCI's, and never in two years has anyone reviewed a patch unless they had a very keen interest in the feature/fix (read: begged for it before-hand). If we progress at this rate, I may as well start from scratch...
Comment #12
kreynen commentedUnlike most of the general use modules you maintain, MERCI was designed specifically to serve the needs of public access stations as part of a Knight News Challenge grant. With the exception of darrick, the majority of the of the users participating are not developers. Most of the people we work with have consistently said they'd like to contribute in some way, but we haven't seen much from them in the areas that don't require development skill... mainly helping with support and documentation. I'm trying to stay optimistic in 2010, but I'm losing faith as well.
If we don't get any volunteers to test the patch by the end of the week, I'll test the changes more thoroughly myself. Of course that will force me to don my crotchy old man hat and spend my days yelling at kids to get off my module.
Comment #13
salvisOk, give them a chance.
Comment #14
kreynen commentedThe PEG community failed me. I went ahead and did more testing myself. Didn't find any issues. Committed this.
Comment #15
salvisThanks!
Comment #16
salvisThere are a few things that you haven't committed — I guess I should have explained them in more detail:
I indented the lines with the form_set_error() calls and you removed two leading spaces for each.
Code like the following is hard to read and hard to maintain:
Above I've solved the following problem: If opening hours are at 9:30, then you label "9:30", "10:30", "11:30" — this isn't so great. There should be labels at the full hours only.
If opening hours are at 9:30, then there should be two 15-minute blocks ahead of 10:00. These two blocks should be the same width as all other 15-minute blocks, meaning there's not enough space for a label. Thus labeling should start only at "10:00". Fractional opening hours will not work correctly without this.
Above I'm doing something similar for fractional closing hours, except it's much simpler. If closing is at 11:15, then there should be only one 15-minute block beginning at 11:00. I'm suppressing the "11:00" label, because it would likely force that last block to be wider than the other 15-minute blocks.
Oops, you left a
date( 'g:i a' , strtotime( $time ) )here. Eliminating the hard-coded am/pm's is what this was all about.This is absolutely essential for supporting opening hours until midnight. After 23:00,
strtotime( $time . ' +1 hour' )will roll over to 00:00 and the loop won't terminate.Above I'm supporting fractional opening hours. 9:30 and 9:40 should have two 15-minute slots ahead of 9:00. 9:45 and 9:59 should have one slot. (The 9:59 case is degenerate, of course, but MERCI should work properly for all inputs that are formally correct.)
Again, we have to be able to generate blocks all the way to midnight, but then we need to stop rather than looping forever.
?>Don't put this at the bottom of any of your Drupal code files. You risk outputting newlines ahead of the HTTP headers, which causes problems. And it's simply unnecessary.
Comment #17
kreynen commentedThere was a hunk that didn't apply on the most recent updates so I manually applied the changes to the version I had been working on. That explains the formatting differences. I thought I applied everything that was rejected.
sreynen (my brother) made an attempt to clean up the formatting, but created a few errors in the process. We didn't have time to deal with those, so we rolled back.
Comment #18
salvisHow do we proceed?
Comment #19
emilyf commentedso this is rolled back and not in the current dev version? i just jumped on the BNN site to take over work, so i'm ready to test for ya. i'm a little confused, like salvis. i'm more than happy to test this out for you, just let me know if there's a patch or what. thanks!
Comment #20
salvisIt's partially applied, but the sections I listed aren't.
I don't know why, and whether it would make sense to prepare another patch with the missing pieces...
Comment #21
ressaI am also ready to test the 24 hour format, dd/mm/yyyy format, and what else needs testing.
Comment #22
salvisThe primary motivation here was to get MERCI to use the site's time format in the cool graph instead of hard-coding the am/pm format. In the process I fixed all the other bugs that I encountered, so this got a bit bigger than expected.
You committed part of this patch, but BETA2 still shows the am/pm format in the cool graph.
All occurrences of
'g:i a'should be replaced by the appropriate calls to merci_format_time(). For exampledate( 'g:i a' , strtotime( $time ) )===>>merci_format_time($time)If it really helps I can create another patch, but given the history of this issue and the fact that this is a trivial change, it probably makes more sense if you just search your current code for
'g:i a'and make the change yourself.Comment #23
kreynen commentedThe reason why this didn't get applied was adding the am/pm without spacing made a mess of the formatting. I added some code to strip the am/pm of as well adding some additional css request back in issue #463906. I think this now looks good for both 12 hour and 24 hours configurations.
Comment #24
salvisOh, I see, the U.S. standard format is 'g:ia' rather than 'g:i a'! And you're using 'g:i' now, without the am/pm? That's what you're showing in wellformatted_merci.png, right?
The 24h format should continue through 13:00, 14:00, and beyond. (Just makeing sure...)
Thanks!
Comment #25
salvisThe hour format looks good now, thanks.
MERCI hangs if I enter admin opening hours through midnight (e.g. 07:00-24:00) and try to preview a reservation with a conflict. That's one of the bugs that I fixed, see #16.5/7 above.
Comment #26
darrick commented@salvis can you roll a patch for #25
Comment #27
salvisAgain? After #5, #9, and #16 I have some doubts whether submitting patches fits into your workflow...
Comment #28
darrick commentedTouché @salvis. patches fit into the workflow and are appreciated. I will close this issue out. #25 should be a new feature request. Thanks.