Closed (works as designed)
Project:
Sheetnode
Version:
7.x-1.x-dev
Component:
SocialCalc
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 May 2012 at 11:30 UTC
Updated:
4 Mar 2016 at 11:26 UTC
Jump to comment: Most recent
Comments
Comment #1
infojunkieThanks for the report. Yes, European-style dates should be supported.
Comment #2
infojunkieActually, you can format European dates by entering a custom number format such as
dd/mm/yyyy.What I want to fix is:
* Present dd/mm/yyyy and d/m/yy format presets
* Recognize input dates in the European format based on the Drupal locale settings
Comment #3
aoristos commentedThe most appropriate (although makeshift) solution for me to let users enter dates in European date format is by 'hacking' the file 'socialcalc-3.js'
I have added 3 lines of code in 'socialcalc-3.js' to make Socialcalc accept date inputs in European format.
The code swaps the day and month values in the submitted date so that Socialcalc can further process the input as a genuine American formatted date.
The algorithm swaps 2 values without creating a additional temporary variable.
I inserted the additional 3 lines of code between the original lines nr. 5548 and nr. 5549 :
(original line 5548 : else if (matches=value.match(/^(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{1,4})\s*$/)) { // MM/DD/YYYY, MM/DD/YYYY)
matches[1] ^= matches[2]; // 1st code line added
matches[2] ^= matches[1]; // 2nd code line added
matches[1] ^= matches[2]; // 3th code line added
(origonal line 5549 : year = matches[3] - 0;)
//The values of matches[1] and matches[2] are swapped using the Bitwise Exclusive OR operator (so DD/MM/YYYY becomes MM/DD/YYYY).
-----------------
Drupal 6.27
Sheetnode 6.x-1.8
Socialcalc code from https://github.com/infojunkie/socialcalc.git
-----------------
Thanks to Infojunkie (and Dan Bricklin) for all the good work !
Comment #4
infojunkieMoving to D7 queue.
Comment #5
hhigel commentedEnabled to input "German Style" date format DD.MM.YYYY by adding the following lines after original line 5560:
Thanks to Infojunkie & Co for this brillant module!
Comment #6
arx-e commented@hhigel
I have pasted your code after line 5560 in socialcalc-3.js but it doesn't seem to work for me.
Cleared caches etc but the behaviour is still the wrong one: entering DD/MM/YYYY dates are interpreted as if they were entered as MM/DD/YYYY.
Any idea about something I might be missing?
Comment #7
willhallonlineThis can be done by editing the formats in the library.