Comments (4)
There's some relevant discussion here http://stackoverflow.com/questions/3085937/safari-js-cannot-parse-yyyy-mm-dd-date-format
from fulcrum.
I patch Date class with the link information and now jasmine test pass, and fulcrum is usable on Safari. I test this on MacOSX 10.6.8 with Safari 5.1 and Safari on IPad
The code:
// if can't parse dates with used format
if(typeof(new Date("2011-11-11"))!=Date) {
// monkey patch it
var orig = Date;
Date = function() {
if(arguments&&arguments.length>0) {
if(arguments.length==1) {
// can I apply the fix?
if(arguments[0].replace) {
return new orig(arguments[0].replace(/-/g,"/"));
} else {
// fallback
return new orig(arguments[0]);
}
} else {
// Date(year,month,day,hours,minutes,seconds,milliseconds) contructor
var a = arguments;
// how to do "new orig(unpack(args))" like lua?
return new orig(
a[0]?a[0]:null,a[1]?a[1]:null,a[2]?a[2]:null,a[3]?a[3]:null,
a[4]?a[4]:null,a[5]?a[5]:null,a[6]?a[6]:null
);
}
} else {
return new orig();
}
}
}
I added this code on project.spec.js and 67 specs pass, and if I added this to fulcrum.js the app is now functional. I not sure what is the best place for that hack.
from fulcrum.
Thanks for that Carlos. I'd prefer a solution that doesn't require a different code path for different browsers. I've pushed a branch called experimental_fix_for_safari_date_parse
, any Safari users able to try it?
from fulcrum.
Sorry, please ignore the request above. This should be fixed by Kale's code in #18
from fulcrum.
Related Issues (20)
- Stories are randomly reordered when dragging between columns HOT 4
- Story IDs and URLs HOT 2
- Could not find compass-rails-2.0.alpha.0 in any of the sources HOT 2
- More drag and drop problems HOT 15
- Unnecessary downloading from the internet in application.html.erb HOT 2
- Proposal for new design HOT 25
- Configuration issue for assets
- Missing english translations / rake task on fulcrum upgrade HOT 4
- don't send mail confirmation HOT 1
- Classic design HOT 12
- Migration Error HOT 1
- find_or_create_by_email method not available on rails 4 HOT 1
- Missing English Translation HOT 17
- find_or_create_by_email deprecated in Rails 4.1.4 HOT 1
- Fulcrum with apache mod_passenger HOT 1
- Add Updating Tutorial
- Error on installation HOT 3
- Is project dead? HOT 9
- Paginate the projects
- add iteration
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fulcrum.