Daily updating content from database

Hi there!
so I want to add the five Islamic daily prayer times to
my website (there are five prayers and each starts when the one before finishes and the times are slightly different every day). For this I made a table for the entire year in the database and I want to update the times for every prayer daily. However, I do not know how to write a code that automatically, everyday, reads the next line in the database and updates the content on the website. (I am attaching the content that will be updated on the website).

Any kind of help would be appreciated!

Sincerely,
Sui

P.S.
I am very new to coding so more specific the answer the better :slight_smile:

The easiest way, using minimum code as possible, would be a repeater like the one you did, with the elements connected to the Collection and filtered everyday using the date. The filtering part is the thing that is going to require some coding.

Can you share your timetable so I can think on a solution?

Thanks.

Hi Bruno, thanks a lot for the reply. I really do appreciate it. I got the attaching to the database part. Just as you said, the filtering is the problem… I am attaching the calendar (this one is for 2021 but it will do :))

Thanks a lot,
Sui

the timetable

If you find that you are having difficulty with code and need assistance, you may want to check out the Wix Marketplace - it’s a place where you can look for Velo experts for hire.

I’m sorry that I took so long to answer, I was quite busy and forgot to check my messages. Unfortunately the link is not available anymore, can you share this timetable again, if it is possible, in Excel format would be amazing.

Thanks.

Hi!
no problem thanks for coming back to me. I can’t for some reason attach the excel file directly. That’s why I am attaching a google spreadsheet link. Hopefully it it will help :slight_smile: Once again thanks a lot!

The link: https://docs.google.com/spreadsheets/d/1kbA-v9y8GeAHxRZ_XQXVtVjyJVdk14n7eIGxRnvapc0/edit?usp=sharing

Best wishes,

Sui

@suadkoh Did you find a solution? I am looking for the same solution.

@suadkoh do you have the table in Excel/Sheets format?

hi, yes though i do not know how to attach it here

no not yet

@suadkoh can you upload to a cloud drive and share the URL?

Hi could you please share your template with me please with the container bioxes or show me how to do it? I Would like to do a similar design on my website :slight_smile:

Hi all!
If you are still interested in the implementation of this task, I propose a proven algorithm. As a basis, I took the table published by Susu Sui in Google and after minor edits, I added one column “DofY” - the day of the year. Using the DATEVALUE function, I calculated for each date in 2022 the day of the year, as an integer, starting from 1. Now, from the current date, you can calculate the day of the year and display the prayer schedule on the display or screen of your mobile phone. In graphical form, the annual schedule looks like this:


Starting from 06/09/2022 to 07/05/2022, the timetable contains the start times of the first and last prayers related to different dates. I didn’t include explanations for users, thinking it would be intuitive. The table is saved in CSV format and uploaded to the site’s collection. All fields are in the “Text” format except for the “DofY” field. I “cut” the published Susu Sui template into 6 parts for use in the repeater. Images recorded in the collection of the site. In the current implementation, only the start time of the prayers is displayed. Susu Sui did not explain the purpose of the other information. When you call the site for control, the date and the current time every second are displayed. information is updated once a day at “0:0”. The change can only be seen at this time or by changing the computer’s system time.
This function is used to determine the day of the year.

//days from NewYear from[1]
function dindex ( today ) {
const year = today . getFullYear ();
const todayms = today . getTime ();
const todayzms = today . getTimezoneOffset () * 60000 ; //Z
let ds = new Date ( year + ‘-01-01’ ); // YYYY-MM-DDTHH:mm:ss.sssZ
const dsms = ds . getTime ();
return Math . floor (( todayms - todayzms - dsms ) / 86400000 ) + 1 //(10006060*24))
}
The example is implemented on the website https://211026a.wixsite.com/mysite-12 including the mobile version.

I would be grateful to anyone who writes comments or suggestions. In particular, is it necessary to implement a schedule view for the following days?
https://211026a.wixsite.com/mysite-12

Could I possibly get a copy of the CSV file you created please

https://docs.google.com/spreadsheets/d/19YW3S96Qy4BTatwUbTCBAlRP1o1aoMYP6JWYWadBtEk/edit?usp=sharing

file csv:
https://drive.google.com/file/d/1KwzcTsL9x2xKnIGDCuHpKvrwBnRBBOF8/view?usp=share_link

You can get the csv file yourself. Open Google Spreadsheet on Google Drive, select the option "Download "as" in csv format"

Please, write:

  1. Did you manage to download the CSV file?
  2. Does schedule switching work correctly in your area?
  3. What needs to be changed on the site?

Hi,

Thanks for sharing - I have downloaded the CSV, but I have been struggling to link the repeater to the data. Unfortunately i am not very technical with Wix. Any help would be hugely appreciated. Thanks