/    Sign up×
Community /Pin to ProfileBookmark

Need IF script based on date trigger

I am creating site about Islam and muslims ([url]www.islammuslim.lv[/url]) and I want that on site would be daily praying times. They changes day from day so I need unique for every day. On internet there is some 2-3 muslim portals who offers javascript code and they send to your site prayer times, but they do not give enough options for making it fit in design.

So I am trying to create my self script in which I could wrote in those prayertimes.

As far as I understand I need something like this:

var now date = 14/03/2007
var now date = 15/03/2007
var now date = 16/03/2007
var now date = 17/03/2007
etc

so if (or case) today = 14/03/2007 then display 04:33 06:43 12:33 15:34 18:24 20:24
so if (or case) today = 15/03/2007 then display 04:32 06:41 12:32 15:36 18:26 20:26
so if (or case) today = 16/03/2007 then display 04:30 06:40 12:32 15:38 18:28 20:28
so if (or case) today = 17/03/2007 then display 04:29 06:38 12:31 15:39 18:29 20:29

etc

So how does it is in Javascript code?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@AhmedAAauthorMar 15.2007 — Here script which I will use:

[CODE]<script language="JavaScript">
var date = new Date();
var today = date.getFullYear() + '/' + date.getMonth() + '/' + date.getDate();

switch (today)
{
case '2007/2/15':
document.write('04:33 06:43 12:33 15:34 18:24 20:24');
break;

case '2007/2/16':
document.write('04:33 06:43 12:33 15:34 18:24 20:24');
break;

default:

}

</script>[/CODE]
×

Success!

Help @AhmedAA spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...