Current capybara-bootstrap-datepicker is not work with japanese locale
When I run the Rspec it give me following error
Failure/Error: select_date(Date.yesterday, xpath: "//input[#id='select_year_month']", datepicker: :bootstrap, format: "%Y/%m/%d")
Capybara::ElementNotFound:
Unable to find css ".month" with text "Jul"
As of the month display are in ja locale like 1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月" instaed of "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
I've just released a new version of the capybara-bootstrap-datepicker gem with localized datepicker support.
An update to the 0.1.1 version should solve your issue.
Related
I've installed highcharts-export-server and the highcharts-regression plugin via npm. These are both installed in my project directory locally. I am using the exporter via a node module. Without the plugin, this all works and is exporting the image. Except, when I include the highcharts-regression plugin I get an error stating "Cannot read property 'data' of undefined".
I'm setting the resources property on the options object for the exporter parameters as a json string with a files property.
Here's my module:
const exporter = require('highcharts-export-server');
module.exports = (callback, classRates) =>
{
var exportSettings = {
resources: "{ \"files\": \"https://cdn.jsdelivr.net/npm/highcharts-regression#2.2.0/highcharts-regression.min.js\" }",
type: 'png',
options: {
title: {
text: 'My Chart'
},
xAxis: {
categories: ["Jan", "Feb", "Mar", "Apr", "Mar", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
},
series: [
{
regresssion: true,
regressionSettings: {name:"reg", type: 'linear'},
type: 'line',
data: [[1, 1], [2, 3], [3, 2], [4,4]]
},
{
type: 'line',
data: [5, 3, 4, 2]
}
]
}
};
exporter.initPool();
exporter.export(exportSettings, function (err, res)
{
callback(null, res.data);
exporter.killPool();
process.exit(1);
});
};
I also read about setting a resource path in the node_modules/highcharts-export-server/build.js file. But I'm not sure which array to put it in.
How do I include this plugin?
UPDATE: Is there a way to get the highcharts instance from the exporter? That way I can import the highcharts-regression plugin myself and initialize it before starting the export.
Okay, I got it working.
First adding allowCodeExecution helped.
But then once I started debugging the highcharts-export-server code in node, I found that there was an exception being thrown by phantomjs when evaluating (by way of injectJs) within highcharts-regression.js.
That module uses for (let i=.... Turns out the let keyword is not supported by phantomjs. This was only used on one line in the whole module, so I created a local copy and edited it to for (var i=... and that fixed that problem.
Now I'm getting my trend line.
But then I also have a "sma" series on the same chart. So I had to edit the node_modules/highcharts-export-server/build.js file and add stock/{{version}}/indicators/indicators.js as a cdnAdditional entry.
If you google how to add extra highcharts modules you will find details on how to do this -- on their forum. Basically you edit build.js then run node build.js from the root of where you have the highcharts-export-server installed by npm (or where you cloned it).
Note that the resources.files property wants a string of well formed JSON. It needs to be a comma separated list of filesystem paths or URIs (that start with http). This property does not want an array of strings. Just a singe string.
For the new gdpr law i am forced to notify the users in europe.
Now i would like to only show this notification to the users in europe.
Whats the best way to do this?
Im using C# and unity3d
Well ... This is almost the solution...
At first, I thought I could use:
System.Globalization.RegionInfo.CurrentRegion
But it turned out that he always displays the "US".
Then I found this plugin:
https://assetstore.unity.com/packages/tools/integration/precise-locale-65836
There libraries for native platforms are used.
PreciseLocale.GetRegion()
It is necessary to compare the received region with:
"BE", "EL", "LT", "PT", "BG", "ES", "LU", "RO", "CZ", "FR", "HU", "SI", "DK", "HR", "MT", "SK", "DE", "IT", "NL", "FI", "EE", "CY", "AT", "SE", "IE", "LV", "PL", "UK", "CH", "NO", "IS", "LI"
Then it remains only to copy the text from the Google's example:
https://developers.google.com/admob/android/eu-consent
and write the code for "npa".
AdRequest request = new AdRequest.Builder() .AddExtra("npa", "1") .Build();
(Sending a value of "1" will serve non-personalized ads)
is it possible, to get multiple search results using ruby geocoder gem? For example - with
Geocoder.search("San jose")
I will see only San Jose, CA
{"address_components"=>
[{"long_name"=>"San Jose", "short_name"=>"San Jose", "types"=>["locality", "political"]},
{"long_name"=>"Santa Clara County", "short_name"=>"Santa Clara County", "types"=>["administrative_area_level_2", "political"]},
{"long_name"=>"California", "short_name"=>"CA", "types"=>["administrative_area_level_1", "political"]},
{"long_name"=>"United States", "short_name"=>"US", "types"=>["country", "political"]}],
"formatted_address"=>"San Jose, CA, USA",
"geometry"=>
{"bounds"=>{"northeast"=>{"lat"=>37.4695381, "lng"=>-121.589154}, "southwest"=>{"lat"=>37.124493, "lng"=>-122.0456719}},
"location"=>{"lat"=>37.3382082, "lng"=>-121.8863286},
"location_type"=>"APPROXIMATE",
"viewport"=>{"northeast"=>{"lat"=>37.4695381, "lng"=>-121.589154}, "southwest"=>{"lat"=>37.124493, "lng"=>-122.0456679}}},
"place_id"=>"ChIJ9T_5iuTKj4ARe3GfygqMnbk",
"types"=>["locality", "political"]}>]
but there are others - in different countries:
How can I get others?
I have been noticing that sometimes the response to an event search returns an event that is outside of the date range in the que3. Here is an example (with my key removed):
http://www.eventbrite.com/json/event_search?app_key=mykey&keywords=Photography&max=10&latitude=34.19751&longitude=-119.1771&within=50&within_unit=K&date=2012-07-20%202012-07-22
Here are the parameters, one per line:
http://www.eventbrite.com/json/event_search
?app_key=mykey
&keywords=Photography
&max=10
&latitude=34.19751
&longitude=-119.1771
&within=50
&within_unit=K
&date=2012-07-20%202012-07-22
If I run this query, I get 3 events, one of which looks like this (with some items shortened for brevity):
"event": {
"box_header_text_color": "005580",
"link_color": "EE6600",
"box_background_color": "FFFFFF",
"timezone": "US/Pacific",
"box_border_color": "D5D5D3",
"logo": "http://...",
"organizer": {
"url": "http://...,
"id": 1066754373,
"name": "Red Brick Gallery"
},
"background_color": "FFFFFF",
"id": 2667310999,
"category": "seminars,entertainment",
"box_header_background_color": "EFEFEF",
"capacity": 8,
"num_attendee_rows": 9,
"title": "Copy of Watercolor Workshops with Joe Cibere",
"start_date": "2011-07-23 14:00:00",
"status": "Started",
"description": "...",
"end_date": "2012-06-16 17:00:00",
"tags": "...",
"text_color": "005580",
"repeat_schedule": "custom-2659333",
"title_text_color": "", ...
I use the keys (under "event") "start_date" and "end_date" to identify the event dates, which spans from 2011-07-23 to 2012-06-16.
The query spans from 2012-07-20 to 2012-07-22.
The date span of the event and the date span of the query don't overlap.
Am I doing something wrong with my query, or is the response incorrect?
Although this event is scheduled to end on '2012-06-16', it is configured to repeat on various dates in the future. See the "repeats" and "repeat_schedule" attributes for more information.
We recently added support for allowing you to access the array of 'start_date' and 'end_date' pairs (per each repeating instance).
The additional response output should be included any time you add a "display" parameter with a value of "repeat_schedule" to the event_get, event_search, user_list_events, or organizer_list_events API calls.
I am currently having a problem with getting the correct time for an event via Facebook's graph API. There are some events showing the correct time and some are not. Even if I am calculating the timezone wrongly, it just doesn't make sense to me.
For example I have the following three events: "Brunch", "Champions league finale" and "Pfingst-Tanz". That's what the graph API gives back:
{
"data": [
{
"name": "Pfingst-Tanz",
"start_time": "2012-05-27T10:00:00",
"end_time": "2012-05-27T14:00:00",
"timezone": "Europe/Berlin",
"location": "...",
"id": "..."
},
{
"name": "Championsleague Finale",
"start_time": "2012-05-19T11:45:00",
"end_time": "2012-05-19T14:45:00",
"timezone": "Europe/Berlin",
"location": "...",
"id": "..."
},
{
"name": "Muttertagsbrunch",
"start_time": "2012-05-13T10:00:00",
"end_time": "2012-05-13T14:00:00",
"location": "...",
"id": "..."
}
],
"paging": { … }
}
On the Facebook page it shows:
Pfingst-Tanz 19:00 (07:00 pm)
Champions league finale 20:45 (8:45 pm)
Brunch 10:00 (10:00 am)
Which results in:
Pfingst-Tanz: Facebook page correct, API incorrect or TZ incorrect in my app
(Champions league finale: don't know, never mind)
Brunch: Facebook page and API correct and same
This just does not correspond to each other. From what I understand it has to be either all wrong or none wrong, but not just 1/3 or 2/3 events. Does anyone have an idea, or am I just too blind to see something?
Your "Brunch" event doesn't include a time zone, so it can't be adjusted to the user's local time zone, which is what I assume Facebook is doing.
It's not immediately clear to me whether the start_time and end_time values are meant to represent the local start/end times (in the given time zone) or the UTC start/end times, but that should be easy enough to work out based on the data (and documentation, hopefully). I suspect it's the UTC start/end when there's a time zone specified, but the local start/end otherwise.