Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
How can I change the first day of a week to Monday?
Comment | File | Size | Author |
---|---|---|---|
#15 | hotel_booking.patch | 9.8 KB | sittard |
#15 | hotel_calendars.patch | 1.61 KB | sittard |
#16 | hotel_booking_admin.patch | 5.43 KB | sittard |
#13 | hotel_booking.patch | 10.07 KB | sittard |
#14 | hotel_booking.patch | 10.51 KB | sittard |
Comments
Comment #1
breitner CreditAttribution: breitner commentedHow can I change the date format to dd.mm.Y (Check-In Date, Checkout etc.)?
And the price is only $ (Dollar). How can I change the price to € (Euro)?
Comment #2
breitner CreditAttribution: breitner commentedSorry, here is a screenshot.
Comment #3
willvincent CreditAttribution: willvincent commentedThese are known issues that will be fixed in an upcoming version.
Please understand, this project was initially under a heavy time crunch which led to not-so-international-friendly code in several places.
But this is on the radar, and has been a todo item for a little while.
If you would like to help speed up the process, patch submissions are welcome. :)
Comment #4
breitner CreditAttribution: breitner commentedHow can I help you prepare the module for other languages?
Unfortunately I have not worked with CVS. Is there an easier way?
I can change all the relevant passages in the modules with t('xyz'). Then I can translate all text with poEdit, but then the changes are not in CVS?!
How can I help you?
Comment #5
willvincent CreditAttribution: willvincent commentedMost of the strings should be wrapped in the t() function already in places that aren't automatically run through it -- some of the menu stuff is automatically processed now, at least I believe that's the case..
If you'd like to work on string translation, you could post the resulting .po file here in the issue queue. As far as helping with the code, there is some excellent information (including a video how-to) on creating patches either through cvs or without cvs at http://drupal.org/patch.
That'd be the best option if you'd like to help with code cleanup and the like.
If you choose to help by writing some patches, please try to keep them specific to a particular issue, so for example, this issue is titled "First day of the week", so it would be good to post a patch to this issue queue that deals with changing the first day of the week from sunday to any other day.
Keeping patches focused to a single issue helps to evaluate them and determine if they solve the issue or introduce new issues, etc.
Another practice I like is naming the patch file in relation to the node id in the issue queue. So a patch for this issue might be FirstDayofWeek-625204.patch
Comment #6
szczym CreditAttribution: szczym commentedSubscribing, mixed currency, mixed date format and no way to change first day of the week are serous stoppers for adoption outside of Us and Australia
Let me know how i can help
Comment #7
szczym CreditAttribution: szczym commentedComment #8
willvincent CreditAttribution: willvincent commentedDetails about how to help with this are outlined in comment #5
Comment #9
ingopingo CreditAttribution: ingopingo commentedsubscribing
Comment #10
sittard CreditAttribution: sittard commentedThe attached patches fix the issue with the currency being displayed only in dollars. The currency can now be set in the UberCart store administration > Store Configuration > Format Settings.
Note: The patch does not change the currency in the admin screens (that needs a bit more work).
Hope that helps!
Comment #11
willvincent CreditAttribution: willvincent commentedThank you for stepping forward to help with this sittard, it's refreshing to see a patch posted.
I took a quick look at the patches, will have to look a bit closer later today when I've got a few moments. I did notice one thing in the second patch. It's not accounting for instances where the currency sign comes after the number.
Rather than
it should probably do something like this..
And somewhere much earlier in the function outside of the loops define $cur_sign_prefix and $cur_sign_suffix something like this:
Or, I think this might be accounted for in the newer price handling functions of ubercart 2.x, but I've not had time to wrap my brain around the price api fully.. lol
Comment #12
sittard CreditAttribution: sittard commentedI think your probably correct it may well need some more work to cater for currency suffixes. I noticed that the cart details panel also has the dollar hard coded so this second patch resolves that albeit with the same issue that you have identified.
Thanks.
Comment #13
sittard CreditAttribution: sittard commentedDuplicate Post!
Comment #14
sittard CreditAttribution: sittard commentedOops I meant to upload this file! Shame you can't delete posts!
Comment #15
sittard CreditAttribution: sittard commentedThis version should allow the currency sign to be set in the UberCart store configuration and allows the currency sign to be displayed after the amount.
The function (uc_currency_format) takes care of most instances except in the calendar module when the number is being rounded (no decimals) and I've borrowed your suggestions from above to fix this.
Comment #16
sittard CreditAttribution: sittard commentedThis patch fixes the issue of hard coded currency symbols in the admin screens.
Comment #17
srobert72 CreditAttribution: srobert72 commentedSubscribe
Comment #18
houen CreditAttribution: houen commentedSubscribe
Comment #19
pobster CreditAttribution: pobster commentedYou could maintain the output using the Format Currency module.
Pobster
Comment #20
larowlanHi
Any currency issues have been resolved in version 2, they all go via Ubercart's uc_price function.
Day of the week still outstanding though.
LR
Comment #21
aem34 CreditAttribution: aem34 commentedhello,
indeed day of week still an issue in order to get all calendars
beginning at "monday" instead of "sunday" if this is configured
in drupal administration for "Date".
is it for those kind of things, you're getting uc_hotel coupled with
"Date" module please ?
Comment #22
aem34 CreditAttribution: aem34 commentedComment #23
larowlanThere's no way to alter the first day of week on the calendars yet.
Happy to receive patches.
Comment #24
willvincent CreditAttribution: willvincent commentedI haven't looked at this code in a long time, nor do I have time to work on a patch for this, but to point someone in a good starting direction anyway...
The table header array is putting in day of week names in the order they appear from the php date('w') format, 0 = SUN through 6 = SAT.
This being the case, one should be able to add an admin setting to determine the start of the week (or maybe hook into that where it's already set somewhere else in the system) and then reorder the header array accordingly, and manipulate the row data accordingly as well.
It's likely going to be a fairly large patch, but shouldn't be an overly significant bit of coding. It occurs to me though that given the integration with views that's been added, it might be better to move the rendering of these calendars that direction as well and implement all of it as a views formatter. That, of course, would be a much more significant undertaking, but I think it might ultimately make it a bit more powerful, at least for a configuration standpoint.
Comment #25
romansta CreditAttribution: romansta commentedSubscribing.
Comment #26
Olivier.b CreditAttribution: Olivier.b commentedhere is a little hack to set monday as the first day of the week in calendars :
you have to edit hotel_booking.theme.inc
- on lines 201, 265 and 400, put the 'Sunday' line at the end of the array.
- on lines 215, 278 and 413 , add this code before the while
it seems to work for me. i hope it will help waiting something nicer.
Comment #27
larowlanAnything in hotel_booking.theme.inc can be overriden with your theme.
Copy the function you want to modify to your theme's template.PHP and rename it appropriately.
Make your changes, flush the cache and you're done.
Comment #28
larowlanremoved duplicate