I am using the date picker that is displayed in the DateInput2 example. In my app I need to act conditionally based on whether the due date is set or not.
If you add a button to your sample app and put this code on click: VarIsUndefined "datePickerValue" "Result" AlertBox "[Result]" "primary" You can see that this detects whether a date is selected or not properly. However, if you select a date and then either clear the date manually or press Pick->Clear the 'Result' is 'False' meaning that it thinks that there is still a date selected.
Any idea how I could detect that they have cleared the date ?
PeteIf I clear the message then the browser typically loads with no further issues. Sometimes though I might get this error up to 10 or 12 times before it is fine. I have also noticed that if I close AB and then restart it, I won't get the error initially the first time that I test in Firefox or Chrome.
Is there something that I should be doing to try and troubleshoot this error? It doesn't stop me from working but it is very inconvenient. Also, while I think of it, I find that whenever I click on an element such as a button in AB in a view in order to access the code behind it, it almost always jumps vertically about 8 pixels and the first thing that I have to do each time is to fix the 'top' value. Am I doing something wrong or is there a preferred way of selecting an element without moving it. Again, not a dealbreaker but it can get frustrating.
PeteSo I have a chores view which has a report in it and the following code is displaying the results properly due to the use of ".toDate()" which is an Angular function (See https://stackoverflow.com/questions/52247445/how-do-i-convert-a-firestore-date-timestamp-to-a-js-date)
When the user clicks on a report row I take them to an edit view with the various fields populated including the due date if populated. I know that I receive the due date from Firestore as a Firestore timestamp and I need to convert that to a javascript date field. This is done by using the built in function "DateToJSDate", in my case I defined it as 'ReminderDate' then I added 'window.App.RootScope.datePickerValue = window.App.RootScope.ReminderDate;' to the js code and everything works well.
Cheers, PeteI am working with a todo list in Firebase/Firestore, each item in the todo list may have a due date field. I am using the new datepicker (from DateInput2 sample) to set each due date in the chore add view.
Firestore stores date data as a javascript timestamp object with two properties: seconds and nanoseconds. If I take a look at the Firestore console I can see each 'DueDate' i.e. '28 August 2019 at 00:00:00 UTC-4', This was just selected as a data in AB but converted itself to a timestamp when pushed to Firestore.
If I use the following code in the report after running my query in the grid view
then the following data is displayed for the DueDate: 'Due Date: Timestamp(seconds=1566878400, nanoseconds=0)' however, I am not interested in time, only the data so I would like to display '28 August 2019' in the chores report (grid view) and also place this date into the date picker on the edit view. Is there a way to convert the timestamp to a date field on retrieval so that I can work with it or is there a better approach?
Thanks! PeteIn my Report I am showing a list of notes including the title and body of the note below in each row. I would like to truncate the body of the note in the grid view if the note is longer than xxx characters. For example, if I set xxx to 16 then "This is a longer sentence that has more than 16 characters" would be truncated to "This is a longer..." but "This is short" would remain as "This is short".
I figured that the easiest solution would be to store the truncated body in a separate field such as note_truncated when adding or editing a record(note) and show 'note_truncated' in the report but show the full 'note' in the edit view.
I was wondering whether you have done anything like this before in AB using existing string functions or would I need to create a custom function?
Thanks, PeteThanks as always, Pete
It looks like I am going to need to deal with this on the client side. I am now looking at the Report sample that uses a select tool to set the sort order field "ArrayGetItem "[Select1.Items]" "[Select1.ItemIndex]" "[Report1.Order]""
Would it be an option for me to somehow set the Notes_Report.Order to the JSON source object field "Created" after I have retrieved the two queries but before I display the report?
PeteEverybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.
This website uses some useful cookies to store your preferences.