# Daily updating content from database

**URL:** <https://forum.wixstudio.com/t/daily-updating-content-from-database/40370>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [June 16, 2021, 8:32pm UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370 "2021-06-16T20:32:05Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![suadkoh](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/suadkoh/32/28883_2.png) [@suadkoh](https://forum.wixstudio.com/u/suadkoh)\
**Post date:** [June 16, 2021, 8:32pm UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/1 "2021-06-16T20:32:05Z")

</div>

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 🙂

 ![](https://us1.discourse-cdn.com/wix/original/3X/c/0/c0e0da68ee199dc511c661025f755367196056d8.png)

---

<div class="post-metadata">

**Author:** ![bwprado](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bwprado/32/7220_2.png) [@bwprado](https://forum.wixstudio.com/u/bwprado)\
**Post date:** [June 16, 2021, 10:06pm UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/2 "2021-06-16T22:06:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![suadkoh](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/suadkoh/32/28883_2.png) [@suadkoh](https://forum.wixstudio.com/u/suadkoh)\
**Post date:** [June 17, 2021, 8:04am UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/3 "2021-06-17T08:04:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![suadkoh](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/suadkoh/32/28883_2.png) [@suadkoh](https://forum.wixstudio.com/u/suadkoh)\
**Post date:** [June 17, 2021, 8:43am UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/4 "2021-06-17T08:43:32Z")

</div>

the timetable

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [June 28, 2021, 11:38am UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/5 "2021-06-28T11:38:58Z")

</div>

If you find that you are having difficulty with code and need assistance, you may want to check out the [Wix Marketplace](https://www.wix.com/marketplace/dynamic-brief?entry=general_corvid_Menu&serviceType=1&innerType=1&origin=velo_forum_networking) - it’s a place where you can look for Velo experts for hire.

---

<div class="post-metadata">

**Author:** ![bwprado](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bwprado/32/7220_2.png) [@bwprado](https://forum.wixstudio.com/u/bwprado)\
**Post date:** [July 1, 2021, 12:29am UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/6 "2021-07-01T00:29:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![suadkoh](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/suadkoh/32/28883_2.png) [@suadkoh](https://forum.wixstudio.com/u/suadkoh)\
**Post date:** [July 1, 2021, 4:43pm UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/7 "2021-07-01T16:43:27Z")

</div>

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 🙂 Once again thanks a lot!

The link: [https://docs.google.com/spreadsheets/d/1kbA-v9y8GeAHxRZ\_XQXVtVjyJVdk14n7eIGxRnvapc0/edit?usp=sharing](https://docs.google.com/spreadsheets/d/1kbA-v9y8GeAHxRZ_XQXVtVjyJVdk14n7eIGxRnvapc0/edit?usp=sharing)

Best wishes,

Sui

---

<div class="post-metadata">

**Author:** ![tarbiyyat](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@tarbiyyat](https://forum.wixstudio.com/u/tarbiyyat)\
**Post date:** [January 20, 2022, 9:35pm UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/8 "2022-01-20T21:35:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bwprado](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bwprado/32/7220_2.png) [@bwprado](https://forum.wixstudio.com/u/bwprado)\
**Post date:** [January 21, 2022, 3:51pm UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/9 "2022-01-21T15:51:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![suadkoh](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/suadkoh/32/28883_2.png) [@suadkoh](https://forum.wixstudio.com/u/suadkoh)\
**Post date:** [January 21, 2022, 5:36pm UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/10 "2022-01-21T17:36:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![suadkoh](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/suadkoh/32/28883_2.png) [@suadkoh](https://forum.wixstudio.com/u/suadkoh)\
**Post date:** [January 21, 2022, 5:37pm UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/11 "2022-01-21T17:37:21Z")

</div>

no not yet

---

<div class="post-metadata">

**Author:** ![bwprado](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bwprado/32/7220_2.png) [@bwprado](https://forum.wixstudio.com/u/bwprado)\
**Post date:** [January 21, 2022, 5:49pm UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/12 "2022-01-21T17:49:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![alnoorandjamiamasjid](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@alnoorandjamiamasjid](https://forum.wixstudio.com/u/alnoorandjamiamasjid)\
**Post date:** [June 17, 2022, 9:59pm UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/13 "2022-06-17T21:59:30Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![211026a](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/211026a/32/4120_2.png) [@211026a](https://forum.wixstudio.com/u/211026a)\
**Post date:** [August 18, 2022, 11:47pm UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/14 "2022-08-18T23:47:36Z")

</div>

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:

![](https://us1.discourse-cdn.com/wix/original/3X/6/8/68028aceb5f913a796d681a17a07c87aa1d0c710.jpeg)  
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 //(1000_60_60\*24))  
}  
The example is implemented on the website [https://211026a.wixsite.com/mysite-12](https://211026a.wixsite.com/mysite-12) including the mobile version.

 ![](https://us1.discourse-cdn.com/wix/original/3X/9/7/973f9e22684c95b831959bd8548fb254113a8c41.jpeg)

 ![](https://us1.discourse-cdn.com/wix/original/3X/1/3/131be97e901921a09f3a81dddc1509ed9531837a.jpeg)

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](https://211026a.wixsite.com/mysite-12)

---

<div class="post-metadata">

**Author:** ![mud-ahmed](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@mud-ahmed](https://forum.wixstudio.com/u/mud-ahmed)\
**Post date:** [December 13, 2022, 7:03pm UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/15 "2022-12-13T19:03:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![211026a](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/211026a/32/4120_2.png) [@211026a](https://forum.wixstudio.com/u/211026a)\
**Post date:** [December 14, 2022, 8:13pm UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/16 "2022-12-14T20:13:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![211026a](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/211026a/32/4120_2.png) [@211026a](https://forum.wixstudio.com/u/211026a)\
**Post date:** [December 14, 2022, 8:22pm UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/17 "2022-12-14T20:22:15Z")

</div>

file csv:  
[https://drive.google.com/file/d/1KwzcTsL9x2xKnIGDCuHpKvrwBnRBBOF8/view?usp=share\_link](https://drive.google.com/file/d/1KwzcTsL9x2xKnIGDCuHpKvrwBnRBBOF8/view?usp=share_link)

---

<div class="post-metadata">

**Author:** ![211026a](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/211026a/32/4120_2.png) [@211026a](https://forum.wixstudio.com/u/211026a)\
**Post date:** [December 14, 2022, 8:32pm UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/18 "2022-12-14T20:32:28Z")

</div>

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

```

---

<div class="post-metadata">

**Author:** ![211026a](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/211026a/32/4120_2.png) [@211026a](https://forum.wixstudio.com/u/211026a)\
**Post date:** [December 18, 2022, 1:45pm UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/19 "2022-12-18T13:45:25Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mud-ahmed](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@mud-ahmed](https://forum.wixstudio.com/u/mud-ahmed)\
**Post date:** [December 20, 2022, 12:28pm UTC](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370/20 "2022-12-20T12:28:34Z")

</div>

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

[Next page](https://forum.wixstudio.com/t/daily-updating-content-from-database/40370.md?page=2)
