How to change Bootstrap daterangepicker language in the sidebar's selector - daterangepicker

Im trying to change the language to Spanish using the locale property. This works fine, but I can only find the properties to translate only some of the strings.
As you can see in the image below, the months and weekdays are translated into Spanish, but the sidebar is not.
Is there any property to change these values?
Locale property:
"locale": {
"format": "MM/DD/YYYY",
"separator": " - ",
"applyLabel": "Aplicar",
"cancelLabel": "Cancelar",
"fromLabel": "Desde",
"toLabel": "Hasta",
"customRangeLabel": "Personalizado",
"daysOfWeek": [
"Lu",
"Ma",
"Mi",
"Ju",
"Vi",
"Sá",
"Do"
],
"monthNames": [
"Enero",
"Febrero",
"Marzo",
"Abril",
"Mayo",
"Junio",
"Julio",
"Agusto",
"Septiembre",
"Octubre",
"Noviembre",
"Diciembre"
],
"firstDay": 0
}

I may be late to the game, but the ranges on the left are not defined in the locale.
They are part of the parameters handed in ranges
ranges: {
'Heute': [moment(), moment()],
'Gestern': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'Aktueller Monat': [moment().startOf('month'), moment().endOf('month')],
'Letzter Monat': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')],
'Januar 2019': [moment([2019,0]), moment(moment([2019,0]).endOf('month')) ],
'1. Quartal 2019': [moment().quarter(1).startOf('quarter'), moment().quarter(1).endOf('quarter')],
'2. Quartal 2019': [moment().quarter(2).startOf('quarter'), moment().quarter(2).endOf('quarter')],
'3. Quartal 2019': [moment().quarter(3).startOf('quarter'), moment().quarter(3).endOf('quarter')],
'4. Quartal 2019': [moment().quarter(4).startOf('quarter'), moment().quarter(4).endOf('quarter')]
},
BTW: I answered to your question not only but mostly because I was looking for exactly what you pasted in your question. So thanks for asking ;-)

Related

Is there a way to write an Expression in Power Automate to retrieve item from SurveyMonkey?

There is no dynamic content you can get from the SurveyMonkey trigger in Power Automate except for the Analyze URL, Created Date, and Link. Is it possible I could retrieve the data with an expression so I could add fields to SharePoint or send emails based on answers to questions?
For instance, here is some JSON data for a county multiple choice field, that I would like to know the county so I can have the email sent to the correct person:
{
"id": "753498214",
"answers": [
{
"choice_id": "4963767255",
"simple_text": "Williamson"
}
],
"family": "single_choice",
"subtype": "menu",
"heading": "County where the problem is occurring:"
}
And basically, a way to create dynamic fields from the content so it would be more usable?
I am a novice so your answer will have to assume I know nothing!
Thanks for considering the question.
Overall, anything I have tried is unsuccessful!
I was able to get an answer on Microsoft Power Users support.
Put this data in compose action:
{
"id": "753498214",
"answers": [
{
"choice_id": "4963767255",
"simple_text": "Williamson"
}
],
"family": "single_choice",
"subtype": "menu",
"heading": "County where the problem is occurring:"
}
Then these expressions in additional compose actions:
To get choice_id:
outputs('Compose')?['answers']?[0]?['choice_id']
To get simple_text:
outputs('Compose')?['answers']?[0]?['simple_text']
Reference link here where I retrieved the answer is here.
https://powerusers.microsoft.com/t5/General-Power-Automate/How-to-write-an-expression-to-retrieve-answer/m-p/1960784#M114215

Tagging Questionnaire Items with a Category

We have different categories of questions in our questionnaires: goals, observations, etc.. I am wondering what the best way to tag individual questions with these labels is. I am considering using Questionnaire.item.code and inserting something of the form {"display": "observation"}
E.g.
{
..
"item": [
{
"linkId": "LittleInterest",
"code": [
{
"system": "http://loinc.org",
"code": "44250-9"
},
{
"display": "observation"
}
],
"text": "Little interest or pleasure in doing things",
"type": "choice",
"required": true,
"answerValueSet": "http://loinc.org/vs/LL358-3"
},
..
}
Is this bad practice? Is there a better way of capturing the question category at the question level?
Putting 'computable' information in display is bad practice. Display is intended for humans, not computation. Also, item.code represents is supposed to refer to a code that represents the full meaning of the question (and 'display' is the official display name for that code). So the meaning isn't what you want.
There's no "standard" way to categorize Questionnaire items. Your best solution would be to define a custom extension.

How do I use FreeFormTextRecordSetWriter

I my Nifi controller I want to configure the FreeFormTextRecordSetWriter, but I have no Idea what I should put in the "Text" field. I'm getting the text from my source (in my case GetSolr), and just want to write this, period.
Documentation and mailinglist do not seem to tell me how this is done, any help appreciated.
EDIT: Here the sample input + output I want to achieve (as you can see: not ransformation needed, plain text, no JSON input)
EDIT: I now realize, that I can't tell GetSolr to return just CSV data - but I have to use Json
So referencing with attribute seems to be fine. What the documentation omits is, that the ${flowFile} attribute should containt the complete flowfile that is returned.
Sample input:
{
"responseHeader": {
"zkConnected": true,
"status": 0,
"QTime": 0,
"params": {
"q": "*:*",
"_": "1553686715465"
}
},
"response": {
"numFound": 3194,
"start": 0,
"docs": [
{
"id": "{402EBE69-0000-CD1D-8FFF-D07756271B4E}",
"MimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"FileName": "Test.docx",
"DateLastModified": "2019-03-27T08:05:00.103Z",
"_version_": 1629145864291221504,
"LAST_UPDATE": "2019-03-27T08:16:08.451Z"
}
]
}
}
Wanted output
{402EBE69-0000-CD1D-8FFF-D07756271B4E}
BTW: The documentation says this:
The text to use when writing the results. This property will evaluate the Expression Language using any of the fields available in a Record.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
I want to use my source's text, so I'm confused
You need to use expression language as if the record's fields are the FlowFile's attributes.
Example:
Input:
{
"t1": "test",
"t2": "ttt",
"hello": true,
"testN": 1
}
Text property in FreeFormTextRecordSetWriter:
${t1} k!${t2} ${hello}:boolean
${testN}Num
Output(using ConvertRecord):
test k!ttt true:boolean
1Num
EDIT:
Seems like what you needed was reading from Solr and write a single column csv. You need to use CSVRecordSetWriter. As for the same,
I should tell you to consider to upgrade to 1.9.1. Starting from 1.9.0, the schema can be inferred for you.
otherwise, you can set Schema Access Strategy as Use 'Schema Text' Property
then, use the following schema in Schema Text
{
"name": "MyClass",
"type": "record",
"namespace": "com.acme.avro",
"fields": [
{
"name": "id",
"type": "int"
}
]
}
this should work
I'll edit it into my answer. If it works for you, please choose my answer :)

How do you add a "PrivateIpAddresses" to a Network interface

I am looking for the output of the troposphere to look like this(json). I could not find any examples to point me in the right direction at all. And in the future if I come across similar issues, is there any documentation I should refer to in particular?
"NetworkInterfaces": [
{
"DeleteOnTermination": "true",
"Description": "Primary network interface",
"DeviceIndex": 0,
"SubnetId": "subnet-yolo",
"PrivateIpAddresses": [
{
"PrivateIpAddress": "xxx.xx.xx.xx",
"Primary": "true"
}
],
"GroupSet": [
"xxxxxx",
"yyyyyy"
]
}
]
Answer was pretty basic. First we need to make a sample_ip like so
sample_ip = template.add_parameter(ec2.PrivateIpAddressSpecification(
"PrivateIpAddress",
Primary="true",
PrivateIpAddress="172.168.1.1"
))
Then do this:
PrivateIpAddresses=[Ref(sample_ip)]
I'll keep this here in case some uber beginner like me is not able to do this on his/her own.

Mandrill API with Handlebars "each-loop" not working

Met problem when using Mandrill API to send transactional newsletters. I chose Handlebars for the template parameters. The user name was shown correctly, but data in the list (post titles) were empty. Please help indicate if anything I did wrong. Thank you!
The template is as below, sent to the endpoint /messages/send.json :
func genHTMLTemplate() string {
return "code generated template<br>" +
"Hi {{name}}, <br>" +
"{{#each posts}}<div>" +
"TITLE {{title}}, THIS {{this}}<br>" +
"</div>{{/each}}"
}
The API log in my Settings panel in mandrillapp.com shows the parameters:
{
"key": "xxxxxxxxxx",
"message": {
:
"merge_language": "handlebars",
"global_merge_vars": null,
"merge_vars": [
{
"rcpt": "xxxxxx#gmail.com",
"vars": [
{
"name": "posts",
"content": [
{
"title": "title A"
},
{
"title": "title B"
},
]
},
{
"name": "name",
"content": "John Doe"
}
]
}
],
:
},
:
}
And below is the email received. "title A" and "title B" are expected after "TITLE".
code generated template
Hi John Doe,
TITLE, THIS Array
TITLE, THIS Array
Mandrill decided to create custom handlebars helpers with some horrible, HORRIBLE names:
https://mandrill.zendesk.com/hc/en-us/articles/205582537-Using-Handlebars-for-Dynamic-Content#inline-helpers-available-in-mandrill
title and url will definitely give you grief if your objects happen to have keys named title and urlas well. Why they didn't name their helpers something like toTitleCase and encodeUrl is beyond me.
As far as arrays and #each is concerned, you can work around it by using {{this.title}} instead of {{title}}.
After testing with Mandrill's sample code here I found the key "title" just doesn't work. Dunno the reason (a reserved keyword of Mandrill?) but replace it with "title1", "titleX" or something else it can be rendered correctly.
{
"name": "posts",
"content": [
{
"title": "blah blah" // "title1" or something else works
},
}
while using handlebars as the merge language 'title' is the reserved helpername which is used in handlebars which makes your text in title case. If you do only {{title}} by default it considers as title the empty text. try giving it {{title title}} which should work or changing the key name to something else ( if you dont want your title in title case )
I know this is late but it could be of use to someone trying to debug this issue currently. Take note of this point in the Mandrill documentation
There are two main ways to add dynamic content via merge tags: Handlebars or the Mailchimp merge language. You may already be familiar with the Mailchimp merge language from creating and editing Mailchimp templates. We also offer a custom implementation of Handlebars, which is open source and offers greater flexibility.
To set your merge language, navigate to Sending Defaults and select Mailchimp or Handlebars from the Merge Language drop-down menu.
I've run into a similar issue on Sending Blue, where their default configuration does not enable handle bars so it won't evaluate them.

Resources