I'm trying to display an expiry date on a passbook coupon. This is the first passbook pass I've created. For some reason, the date isn't showing up on the pass.
Screenshot:
http://screencast.com/t/looDjpqT
JSON Code for Date:
"secondaryFields" : [
{
"dateStyle" : "PKDateStyleMedium",
"isRelative" : true,
"key" : "expires",
"label" : "Valid On",
"timeStyle" : "PKDateStyleNone",
"value" : "2012-10-12T12:00:00-05:00"
}
],
Any idea why this date simply isn't showing up on my pass?
Your code is fine. The problem is the built-in OS X passbook viewer does not show the date for some reason. It works on a real device though.
It seems to be only taking combined date and time in UTC, such as "2012-10-13T06:00Z"
A complete example:
{
"key": "date",
"label": "Date and Time",
"dateStyle": "PKDateStyleMedium",
"timeStyle": "PKDateStyleShort",
"value": "2012-10-13T06:00Z",
"isRelative": true
}
The timeStyle tag doesn't appear correct. It should be PKTimeStyleShort instead of PKDateStyleShort.
Related
I have built a custom neural model using the Form Recognizer Studio. I have marked the date fields when I labeled the data to build the model.
I have problems extracting the exact date value using the following Java SDK:
com.azure:azure-ai-formrecognizer:4.0.0-beta.5
The returned JSON (as previewed in the Form Recognizer Studio) is:
"Start Date": {
"type": "date",
"content": "01.05.2022",
"boundingRegions": [
{
"pageNumber": 1,
"polygon": [
1.6025,
4.0802,
2.148,
4.0802,
2.148,
4.1613,
1.6025,
4.1613
]
}
],
"confidence": 0.981,
"spans": [
{
"offset": 910,
"length": 10
}
]
}
If I am using the Java SDK, then the getValueDate() returns null, while the getContent() returns the correct string value.
Most likely the issue occurs because the document I use is not in English and the date format might not be recognized. As per documentation here: https://learn.microsoft.com/en-us/azure/applied-ai-services/form-recognizer/language-support only English is supported for custom neural models.
I want to fill a slot not at the beginning of the invocation of the intent, but at a later part in the intent request. I want to provide user some options, and I want them to select one out of those. For that I'm trying to use Dialog.ElicitSlot, but somehow I'm getting an error :
"Request to skill endpoint resulted in an error."
I'm returning this when I need the user to select an option from my list.
return {
"version": "1.0",
"sessionAttributes": {},
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "These are the multiplex" + ("es" if len(multi_list) > 1 else "") + " " + outputSpeech + ". Please select one out of these."
# outputSpeech contains the list of options I want the user to select from
},
"shouldEndSession": False,
"directives": [
{
"type": "Dialog.ElicitSlot",
"slotToElicit": "MULTIPLEX",
"updatedIntent": {
"name": "GetMovieDetails",
"confirmationStatus": "NONE",
"slots": {
"CITY" : {
"name" : "CITY",
"confirmationStatus" : "NONE",
"value" : city # this is already filled, it is just anti-capitalised
},
"NAME" : {
"name" : "NAME",
"confirmationStatus" : "NONE",
"value" : movie_name # this is already filled, it is just anti-capitalised
},
"MULTIPLEX" : {
"name" : "MULTIPLEX",
"confirmationStatus" : "NONE",
}
}
}
}
]
}
I'm testing my skill using python-lambda-local, it is working fine on my local machine (I just had to change the dialogState to "COMPLETED" manually, like the one here). It returns everything written above. But It gives an error while testing it on Skill Tester. Here is the output which is returned in the Skill Tester.
PS : I did not check the Slot Filling check box in the Build Section. (As I need the slot to be filled later), and here is the complete code just in case.
Try with omitting the entire "updatedIntent" part, as this information is not required for ElicitSlot.
But more important: You have to make sure that your script returns actual text in JSON-format!
Have a look at http://flask.pocoo.org/docs/1.0/api/#flask.json.jsonify
or https://docs.python.org/2/library/json.html
God, I hate to admit this.
The Dialog.ElicitSlot works fine, and the way I expect it to do so.
The error with my code is, there is no error. I figured my skill was taking some time to fetch data from remote site and doing some calculations on it. So I increased the time out and bam, it worked.
It is always a better to test your skill locally, but it is great to test it once on the aws lambda console. I don't know why I didn't do that earlier.
So to conclude, I just had to increase the timeout in my skill.
I need to create pivot data by applying filter of two fields i.e city and date range.
Able to filter data by cities and date range but filter is not applying on stats field.
Following is the Solr query that i'm using :
select?&fq={!tag=f1}city:(%221000%20OAKS%22)&facet=true&facet.query=true&facet.query={!tag=queryOne}datadate:[2015-01-01%20TO%202015-12-31]&facet.query={!tag=queryTwo}datadate:[2014-01-01%20TO%202014-12-31]&stats=true&stats.field={!tag=a1%20sum=true%20key=charge1}charge&stats.field={!tag=a2%20sum=true%20key=spend1}spend&facet.pivot={!query=queryOne%20key=c1%20stats=a1}city&facet.pivot={!query=queryTwo%20stats=a2%20key=c2}city&facet=on&indent=on&wt=json&rows=0&q=:
Actual Result :
As you can see, the sum remains same (i.e 2348) regardless of what datadate i m giving in queryone & querytwo tags.
It appears that datadate filters is not having any effect on stats field.
Can anyone please explain what is happening here as i'm pretty new to this.
Thanks in advance.
The problem is that the StatsComponent & FacetComponent are not in perfect integration with each other. The following Solr Jira comprises your use-case: SOLR-6348.
But nevertheless there is work-around for your use-case via JSON Facet API. Here is facet parameter which solves your particular use-case:
{
"date_range": {
"type": "range",
"field": "datadate_dt",
"start": "2014-01-01T00:00:00Z",
"end": "2016-01-01T00:00:00Z",
"gap": "%2B1YEAR",
"facet": {
"cities_and_spends": {
"type": "terms",
"field": "city_s",
"facet": {"sum_of_spend": "sum(spend_d)"}
},
"cities_and_charges": {
"type": "terms",
"field": "city_s",
"facet": {"sum_of_spend": "sum(charge_d)"}
}
}
}
}
Hence the overall GET request would look like:
.../select?indent=on&q=*:*&fq=city:(%221000%20OAKS%22)&rows=0&wt=json&json.facet={%20%22date_range%22:%20{%20%22type%22:%20%22range%22,%20%22field%22:%20%22datadate_dt%22,%20%22start%22:%20%222014-01-01T00:00:00Z%22,%20%22end%22:%20%222016-01-01T00:00:00Z%22,%20%22gap%22:%20%22%2B1YEAR%22,%20%22facet%22:%20{%20%22cities_and_spends%22:%20{%20%22type%22:%20%22terms%22,%20%22field%22:%20%22city_s%22,%20%22facet%22:%20{%22sum_of_spend%22:%20%22sum(spend_d)%22}%20},%20%22cities_and_charges%22:%20{%20%22type%22:%20%22terms%22,%20%22field%22:%20%22city_s%22,%20%22facet%22:%20{%22sum_of_spend%22:%20%22sum(charge_d)%22}%20}%20}%20}%20}
In response i will receive a date like '2016-09-07 20:00:23.234 IST' and am trying format the date like '07/Sep/2016 20:00:23.234' with help of ui-grid cellFilter.
like
{
"name": "creationTimestamp",
"type": "date",
"cellFilter": "date:'MM/dd/yyyy HH:MM:ss.SSS'"
}
But it's not working it. still i am getting as result like'2016-09-07 20:00:23.234 IST'. Can you please help me?
we can also use custom filter, if we want to do handle timezone
{
"name": "creationTimestamp",
"type": "date",
"cellFilter": "dateConversion"
}
app.filter('dateConversion', function(){
return function(date,timezone){
return (timezone ? moment.tz(date) :moment.utc(date)).format('DD/MMM/YYYY HH:mm:ss.sss');
};
})
I got the solution with cellFilter:
'date:"dd/MMM/yyyy HH:mm:ss.sss"'
Not sure if this helps now but i have the same issue where my date was string formatted using moment. I ended up using toDatefrom moment
my creationTimestamp was:
moment.utc(utcDate).local().format('MM/DD/YYYY HH:MM:ss A')
this was failing during sort, So i changed it to
moment(moment.utc(utcDate).local().format('MM/DD/YYYY HH:MM:ss A')).toDate()
and changed my cell filter as, removed the type 'date'
{
"name": "creationTimestamp",
"cellFilter": "date:'MM/dd/yyyy hh:mm:ss a'"
}
Now the display and sorting works fine on ui-grid
I recorded a test with Selenium IDE but when I try to run the test I get an error [error] Element id=jsonform-0-elt-businessActor not found
I also noticed this particular field's id is slightly different.. The rest of the fields have this format id=jsonform-0-elt-0.nameOfJsonAttribute
Could there be any reason why the bussinessActor ID is not working and captured differently?
JsonSchema used to render the form:
{
"type":"object",
"id": "001",
"title": "testSchema",
"properties":{
"businessActor": {
"type":"string",
"title": "Name",
"description": "example of a description."
}
}
}
Note: Am using jsonForm to render the form based on json shema. Form id's are generated dynamically by jsonFom. And am also using Angular.js (angular is not playing a role in this aprticular issue, I think)
As #MarkRowlands suggested, it sounds like your page is dynamic.
Try this out as your target...
css=[id^='jsonform'][id$='businessActor']
^= means 'starts with' in css. $= means 'ends with' in css.
Change that selector to match whatever you would like to select.