AngularJS - Is it possible to show data in a specific time range? - angularjs

hope someone can help me with this question.
I have an entity which contains a start time (let's say 15 o'clock) and an end time (let's say 16
o'clock). It also contains the date (let's say today^^).
So my query returns all data of today, but I only want to show the data between 15 and 16 o'clock.
Do I need to set a $timeout for each object? Or is it possible to automatically call a method called shouldShowData which used in ng-show?
Basically I have a list of objects and want to show single object just on a specific time of the day.
EDIT
Imagine that the screen is shown in a public place and displays different news at different time (morning news, evening news, ...) and should automatically update when the specific news should be displayed based on it's start and end time. It can't be updated manually with a refresh button for example.
Great to here from you :)

I have found similar problem and solution for it here
All you need is to wrap this into $filter and use on ng-repeat.

Related

How to query/ lazy load next batch if the current result did not fill up the page in React native

I am currently building a calendar schedule view feature, where I have Month title as Header and the days as the items. I am currently fetching calendar event of about 6 weeks. which if the data is not present or so, it would still cover up the page and I can use onScrollEnd to query more data via useQuery.
But, I am trying to optimize my calendar feature and querying 6 weeks worth of events would not be ideal and would take time to load. thus, I was trying to find a way, where, if I can query let's say 1 week worth of data, if that does not have enough data (like 1-2 events) to cover the screen (for user to invoke onScrollEnd), then query next batch and so on and at the end wrapping the container with memo in order to help boost the load speed and lazy load data as required. Any idea how would this be possible?
I have looked at various examples of lazy loading such as:
https://snack.expo.dev/#johnborges/044274
etc, but my problem is that in these code examples, they do not cover the possibility of first or second batch/ page to have less data and querying for next page automatically.
I also thought of using FlatList nested with SectionList, but ended with conclusion that it would not be possible and data would be rendered twice.
What I want to happen:
<Schedule> --> component
render → Coordinate which Month in the SectionList should paginate through the events
<SectionList>
onEndReached → create more months
<Month>
<FlatList>
render → <Event />
onEndReached → fetch more events
<FlatList>
</Month>
</SectionList>
<Schedule>
So there are two "onEndReached" triggers, one to create more months when the user scrolls down the entire page and a second to get more events, when the user scrolls down the current month.
The Month component should just load 1 weeks worth of events at a time and paginate as the user is scrolling.. I somehow need some way to figure out that if the current week does not have enough data to cover the screen then query more data, and so one as always show the full page... Any help/ ideas would be appreciated. Thanks :).
I would try to measure the y position of the last element. If the y position is not close enough to the bottom, fetch more items. Store the previous fetch in the state. Add to that state the new fetch.

how to create different UI components every times in runtime and save their contents into database and save the UI which created on the page?

Dears
good day
I need your help for the following case:
The activity nature of the client is very dynamic
Need to have a dynamic form (he wants to create many form every day by himself in runtime). And add some components in the runtime.
He doesn't have a standard form so he need every day to create new form
For example he can make today a form with group of input text and group of check box and table and tomorrow he need to make a new form with input text and radio and table also etc..,.
In addition he needs to achieve and save it into database to use it and retrieve it later , and he wants to save every form with its UI contents which he created in runtime to be able to view it later on the jsf page.
So he want to save created form contains data into database
And also he wants to arrange the component on the page by his own way
And I putted this case in OTN :
https://community.oracle.com/message/14356236#14356236
How could I do it?
Regards
You can find a series of blog posts of Andrejus, right here:
http://andrejusb.blogspot.co.uk/2015/09/adf-12c-dynamic-forms-with-adf-bc-ui.html

Making an Access Filter-Macro Based on Text-Field Input

I've been wracking my brains on this simple macro for days and troweled almost every site and forum for an answer, to no avail. Thus, I come to the gurus of stackOverflow for my salvation:
I'm working in Access 2010 and have a database of events that are coming up. Right now the database opens to a form wherein any user may view the entered events and edit them if there's an error. Likewise, there's a report that pulls it's list from the form that everyone's working on.
What I'd like to do (for ease of use) is have a text field and a button. The field would be for date-input (i.e. 10/20/2015) and when pushed, the button would filter the list of events to show only things on or after the typed date. Likewise, I'm hoping to make another filter for the report that will display items only btw. certain dates (but I'm really just working on the first item).
The concept would look like this:
| [ Text Field | [BUTTON]
Event 1 ...................... Date.........
Event 2 ...................... Date.....
....
..
.
Note: This is a database for people who know NOTHING about Access, so I'm trying to spoon-feed the stuff they need to them.
I really appreciate the help, folks.

Is there a way to quickly add a new row of fields on a visulforce page?

I am trying to create a incident log in safesfore. The key aspect is that everything can be added on the same page reducing the amount of clicks that have to be made. There are 6 fields i have created:
Date Opened, Date closed, incident, reported to, reported by and notes.
I was wondering if there is a way to create an "add new" button that will create another row of the fields i have just lised. The idea being that the page does not refresh it is all done in real time.
Many thanks
You'll need a custom Visualforce page implementation.
There are 2 ways to do it
1) Building a list of records on apex and iterate over that list displaying the fields on the front end (vf page apex:repeat)-- Then when the button "add new" is clicked you'll append an empty record to the list and re-render the apex:repeat to reflect the changes.
This is good because you don't need a lot of boilerplate code since the records with be binded with the backend. However, the rerendering can lead to some performance issues in my experience.
2) Build a custom Javascript implementation, where you have an in memory collection and using DOM manipulation add/remove rows of the list. When the user saves the data from memory must be sent using JSON and a VF Remoting method can perform the JSON parsing and saving the rows.
Both are valid, the first is good to avoid boilerplate but the second is much faster (but you need to write some boilerplate).

VB.net Winforms dropdownbox data load question

I have a VB2005 winforms application that will loads city data from my database table. This is to ensure that the user enters the correct city spelling, in order to receive an accurate quote. Currently, there are about 150K cities that are being loaded to the dropdown listbox on page load. It takes about 30-40 seconds for that page to load.
My initial thought was to allow the user to select the state first. Then load the city values. But the user has the option of going back and requesting a quote for a different city / state.
Is there a more efficient way to handle this?
Quotes are based on state and city name? If so, your approach sounds good, but consider basing quotes on zip instead, or zip/city name. Not everyone will find their city in your 150K list, and some don't live in named cities at all.
For starters you could have a BackgroundWorker or Thread load the data in the background into an array or list. You'd then pass this data to the comboBox when needed.
If you use this method, you must find a way of reindexing the fields from time to time though.

Resources