473,324 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

I'm looking for a oneline text "event calender"

I want to have a javascript that places a greeting depending on the date
for example ; from Dec.20 till Dec.24 it will say "have a nice holiday"
and Dec. 25 and 26th it says "Merry Christmas" and Dec 31
"be careful full whit fireworks" ect. ect.

ps. it don't have to display a date,
I already have a script that displays the date
Who can help me with this
Jul 20 '05 #1
1 1699
JRS: In article <Xn********************@212.83.64.216>, seen in
news:comp.lang.javascript, John Thermae <tr**@dsv.nl> posted at Tue, 18
Nov 2003 09:08:15 :-
I want to have a javascript that places a greeting depending on the date
for example ; from Dec.20 till Dec.24 it will say "have a nice holiday"
and Dec. 25 and 26th it says "Merry Christmas" and Dec 31
"be careful full whit fireworks" ect. ect.


I hope that you are writing it in Dutch, or that you get the spelling
independently checked.

In what way did the FAQ - see in references below - prove inadequate?

with (new Date()) PsoD = (getMonth()+1)*100 + getDate()

document.writeln(
PsoD>=1220 && PsoD<1225 ? "hanh" :
PsoD==1225 || PsoD==1226 ? "MC" :
PsoD==1231 ? "bcfwf" : "normal day"
)
For a longer list, note that the problem is similar to that solved in
Subject: Re: HELP - "On This Day" javascript code
Date: Mon, 10 Nov 2003 13:56:06 +0000
Message-ID: <Si**************@merlyn.demon.co.uk>
provided that the individual events do not span many days (then, that
form of data storage would be inefficient)

var List = {
D0704: 1,
D0705: 1,
D0423: 2 }

today = "D0423"

if (T=List[today]) alert(S[T])

where T is an array of legends in which entry zero is dummy("").

For large spans, noting that it may be useful to get an empty string
returned on a non-special day, use a data structure like

List = [
[1220, 'hanh'],
[1225, 'MC'],
[1227, ''],
[1231, 'bcfwf'] ]
and scan it to find the last entry for which the number has been
reached.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Corepaul | last post by:
I am a newbie using Access 2000. I am using the following test in the txtAlbum OnExit procedure to prevent leaving an empty text box for a required field If (IsNull(txtAlbum.Value)) Or...
2
by: Eddy Bee | last post by:
Hi there, I'm encountering an inexplicable problem with page formatting in reports. Here's the easiest way to explain it: The Detail section of my report contains two elements: And let's...
1
by: charliewest | last post by:
I would like to implement the following functionality: When a user taps a (child) treeNode, an event fires which allows me to get the selected treeNode's TAG object, determine it's values, and...
5
by: Verde | last post by:
I'm using a 3rd party component in an ASP.NET 1.1 Web application. The component has a .Click event that can be fired from the client, with an associated event procedure in the code-behind module....
3
by: Skevmeister | last post by:
Hi Guys, Ok, so I have now figured out how to create and watermark and resize and resample images for my website, but now I want to trap the "save picture as" event so that I can create another...
5
by: Jason | last post by:
Hello, I am trying to dynamically create a table, then set its <td>'s onclick: var table = document.createElement("table"); var row = table.insertRow(-1); var td = row.insertCell(-1);...
2
by: yevron2 | last post by:
Hello, I am tring to write a clipboard spy that catches events from the clipboard. I used the SetClipboardViewer api to get events when data is copied into the clipboard, and also...
6
by: alexia.bee | last post by:
Hi all, I need to write app in C# that communicates with other app. I need to use "named event" for that. I should use windows APIs SetEvent() and WaitForSingleObject() etc... I looked for help...
3
by: dvanderwel | last post by:
I have a .NET 1.1 web page with a DataGrid containing a TemplateColumn that contains a DropDownList. I need to fire an event when the selected item in the DropDownList changes for the current...
4
by: robertallenpayne | last post by:
I have been asked to develop an application in Access for work. This application must have a simple user interface because the folks using it are not "database people" - their words, not mine. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.