Tapku calender customization - ios7.1

I'm using Tapku calendar for my iOS app. I have something to do like this.
I'm getting a JSON array of data from the web service. It's something like this:
dates":[{"day_id":1,"color_id":1},
{"day_id":2,"color_id":1},
{"day_id":3,"color_id":1},
{"day_id":4,"color_id":1},
{"day_id":5,"color_id":1},
{"day_id":6,"color_id":1},
{"day_id":7,"color_id":1},
{"day_id":8,"color_id":1},
{"day_id":9,"color_id":1},
{"day_id":10,"color_id":1},
{"day_id":11,"color_id":1},
{"day_id":12,"color_id":1},
{"day_id":13,"color_id":1},
{"day_id":14,"color_id":1},
{"day_id":15,"color_id":1},
{"day_id":16,"color_id":1},
{"day_id":17,"color_id":1},
{"day_id":18,"color_id":1},
{"day_id":19,"color_id":2},
{"day_id":20,"color_id":2},
{"day_id":21,"color_id":1},
{"day_id":22,"color_id":1},
{"day_id":23,"color_id":1},
{"day_id":24,"color_id":1},
{"day_id":25,"color_id":1},
{"day_id":26,"color_id":1},
{"day_id":27,"color_id":2},
{"day_id":28,"color_id":1},
{"day_id":29,"color_id":1},
{"day_id":30,"color_id":1},
{"day_id":31,"color_id":1}]}
Each day has a particular colour to show on the calender. colour_id 1 -red,2-green and 3-yellow.
I can change the
- (NSArray*)calendarMonthView:(TKCalendarMonthView *)monthView marksFromDate:(NSDate *)startDate toDate:(NSDate *)lastDate
by giving dates with the colour id. My problem is how can I change the select image in Tapkucalenderby checking the colour_id coming along with a particular date.
This is what I need to do with my TapkuCalender

Related

API Response - How to handle response in React

I'm trying to work with an API that sends out a list of questions to create a question set. This is the response from the API:
{"questionSetItems":[[1,"From which date would you like your insurance to start from?","This is the date on which you want the policy to begin. The policy will not pay for any claims which occur prior to this date.","Dropdown",[],"",false],[2,"What is your title?","","DropDown",[],"",false],[3,"What is your title?","","DropDown",[],"",false],[4,"What is your forename?","","Edit",[],"",false],[5,"What is your surname?","","Edit",[],"",false],[6,"What is your date of birth?","","Date",[],"",false],[7,"You and your spouse or partner are not: <br\/>Professional Sportspeople<br\/>Professional Entertainers<br\/>Professional Gamblers<br\/>Moneylenders or Pawnbrokers<br\/>Bailiffs or Bodyguards<br\/>Bar Managers<br\/>Car Dealers\/Salespeople<br\/>Circus or Fairground Employees\/Owners<br\/>Clairvoyants, Tarot Readers or Palmistry Experts<br\/>Croupiers, Gaming Club Managers\/Proprietors<br\/>Diamond or Metal Dealers<br\/>Exotic Dancers<br\/>Jewellers or Jewellery Consultants<br\/>Street\/Market Traders<br\/>Tattooists<br\/>Student<br\/>Unemployed\/In voluntary employment<br\/><br\/>Please confirm that you agree to the above statements.","","YesNo",["inputEmploymentYes","inputEmploymentNo"],"",true],[8,"Please select the relevant employment types for both you and your spouse or partner","","ButtonList",["inputSportspeople","inputEntertainers","inputGamblers","inputBar","inputBailiffs","inputMoneyLender","inputTarot","inputCircus","inputCar","inputExotic","inputDiamond","inputCroupiers","inputTattooists","inputStreet","inputJewellers","inputVoluntary","inputUnemployed","inputOther","inputStudent"],"partnerType",false],[9,"Do you need to add a joint policyholder?","","YesNo",["inputJointHolderYes","inputJointHolderNo"],"",true]],"headerLogo":"","cOB":"STDH","isLastPage":false}
How to look through the array in React?
yo
u can use like this .u can keep it in a variable name and u can check in which key ur getting the array of datas , then you can map the fields and u will get data
enter image description here

How do I show the proper time on my intraday chart using AnyChart?

I have downloaded hourly stock data for AAPL for the past 30 days and am displaying a candlestick chart. The chart loads properly but the time shown for each bar is incorrect. I am in the Pacific time zone.
I tried changing the way the data table is created but none of the ideas below seem to help.
var dataTable = anychart.data.table(0);
var dataTable = anychart.data.table(0, '', 8);
I am using the same example as the one on the AnyChart website https://www.anychart.com/products/anystock/gallery/Stock_General_Features/Showing_Intraday_Data.php
Please see the following 2 images.
For the ORCL chart from the example on the AnyChart website, I clearly see the date and time (highlighted rectangle)
working example from AnyChart website
For my chart (for AAPL hourly data), the time is off and it shows "13 05 Nov 2021" etc.
Does not work for my data
My source CSV file contains data as below (full CSV available at this link)
timestamp,gmtoffset,datetime,open,high,low,close,volume
1634650200000,0,2021-10-19 13:30:00,147.009994,148.820007,146.550003,148.759994,24069759
1634653800000,0,2021-10-19 14:30:00,148.759994,149.169998,148.229995,148.384994,13899143
1634657400000,0,2021-10-19 15:30:00,148.380004,148.759994,148.220001,148.759902,7623131
1634661000000,0,2021-10-19 16:30:00,148.759704,149.044998,148.5,148.889999,6263260
1634664600000,0,2021-10-19 17:30:00,148.884994,148.979995,148.479995,148.535003,4807906
1634668200000,0,2021-10-19 18:30:00,148.539993,148.837295,148.330001,148.460006,6333632
....
Thanks to AnyChart for responding so quickly via email.
The following snippet solves the issue with the tooltips and now I can see the proper date and time on the tooltip.
chart.tooltip().titleFormat(function() {
return anychart.format.dateTime(this.x, 'yyyy-MM-dd HH:mm:ss');
});
To set the proper legend, the following code does it:
plot.legend().title().useHtml(true);
// configure the format of the legend title
plot.legend().titleFormat(
"<span style='font-weight:600'>" +
"{%hoveredDate}{dateTimeFormat: yyyy-MM-dd HH:mm:ss}</span>"
);

Grouping fields in Google Data Studio

In Google Data Studio, I am trying to group different stages and assign them to a group for viewing in a sales funnel. The data are all strings. What I'm confused about is the fact that this data works just 1 or 2 weeks ago and the graph is already there. However, when I try to change the grouping, it shows the error "Invalid formula" or "Failed to create field. Please try again later"
I have also tried to clone this code to create another field and it doesn't work at all. Have anyone encountered this problem and found a solution?
Here is the associated code:
CASE
WHEN Stage IN ("Interested", "Good Lead", "Good Leads") THEN "Prospected"
WHEN Stage IN ("Attempted 1st", "Attempted 2nd") THEN "Attempted"
WHEN Stage IN ("Contacted", "Lukewarm Lead", "Warm Lead", "Cold Lead", "Qualified Lead") THEN "Contacted"
WHEN Stage IN ("Course Chosen") THEN "Docs Collection"
WHEN Stage IN ("Document Collected", "School Applied") THEN "School Applied"
WHEN Stage IN ("Paid") THEN "Paid"
WHEN Stage IN ("Visa Applied") THEN "Visa Application"
WHEN Stage IN ("Finished") THEN "Won"
ELSE "0"
END
Created a Google Data Studio Report (Google Sheets Embedded) to try out the CASE statement, and it works as expected.
Is the data structured as displayed in the Report and Visual below?
What's the Data Source (e.g. Google Sheets)?
Have you tried Refreshing the Data Source?
What browser are you on (e.g. Chrome)?
In addition to reloading the page (F5), you could try a Hard Reload (Ctrl + F5);
If the formula was created at the Data Source-level, you could try whether it works when creating it at the Chart-level (as shown in the visual below).

How to order by date defined on context model wagtail

i am getting and error trying to order by a fecha_inicio_evento date field on my model https://gist.github.com/9d3e1b3874eb43e6932699b7ea4b13c6 this is the screenshot of my error https://i.imgur.com/ifJzKc0.jpg ,
can you give me a hand folks not sure what i do wrong.
You have to use .specific() at line 23 of your models.py like this:
talleres = self.get_children().live().specific().order_by('-fecha_inicio_evento')

Build an array from yaml in rails

I'm working on a simple rails app that does SMS. I am leveraging Twilio for this via the twilio_ruby gem. I have 10 different phone numbers that I want to be able to send SMS from randomly.
I know if I do something like this:
numbers = ["281-555-1212", "821-442-2222", "810-440-2293"]
numbers.sample
281-555-1212
It will randomly pull one of the values from the array, which is exactly what I want. The problem is I don't want to hardcode all 10 of these numbers into the app or commit them to version control.
So I'm listing them in yaml (secrets.yml) along with my Twilio SID/Token. How can I build an array out of the 10 yaml fields i.e. twilio_num_1, twilio_num_2, etc, etc so that I can call numbers.sample?
Or is there a better way to do this?
You can also use
twilio_numbers:
- 281-555-1122
- 817-444-2222
- 802-333-2222
thus you don't have to write the numbers in one line.
Figured this out through trial and error.
In secrets.yml
twilio_numbers: ["281-555-1122","817-444-2222","802-333-2222"]
In my code:
Rails.application.secrets.twilio_numbers.sample
Works like a charm.
create a file: config/twilio_numbers.yml
---
- 281-555-1122
- 817-444-2222
- 802-333-2222
and load it in your config/application.rb like this:
config.twilio_numbers = YAML.load_file 'config/twilio_numbers.yml'
you can then access the array from inside any file like this:
Rails.application.config.twilio_numbers
=> ["281-555-1122", "817-444-2222", "802-333-2222"]

Resources