• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

build phone app daily devotional

Explorer ,
Sep 14, 2016 Sep 14, 2016

Copy link to clipboard

Copied

Building my first phone app using Dreamweaver CC, Visual Studio 2015, and hopefully PhoneGap to pull it all together. Coding with HTML5, CSS, and Javascript.

Goal: create a daily devotional app. Problem: How to have specific text show beneath "today's date"?

Any help and pointers towards tutorials would be much appreciated.

Views

1.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 15, 2016 Sep 15, 2016

Copy link to clipboard

Copied

A basic "Quote of the Day" JavaScript.

// JavaScript Document

//**********************

// QUOTE OF THE DAY SCRIPT: Add 31 quotes or inspirational messages to the array below. Each day a new quote will be displayed.

//***********************

var date    = new Date().getDate();

var quote   = new Array();

quote[1]   = "The mind is everything. What we think we become. --Buddha";

quote[2]   = "Adults are just outdated children. --Dr. Seuss";

quote[3]   = "The secret of getting ahead is getting started. --Mark Twain";

etc...

Nancy O.

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 23, 2016 Sep 23, 2016

Copy link to clipboard

Copied

Thank you for responding. Is there a way to pull automatically from a preset list for each day and not just pull randomly? So for example July 4th every year it will be the same inspirational message.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 23, 2016 Sep 23, 2016

Copy link to clipboard

Copied

Also, I already have id's on each message.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 23, 2016 Sep 23, 2016

Copy link to clipboard

Copied

The script above is not random.

Each day of the month 1-31 contains a quote.  If the current date is 23rd, you'll see the quote corresponding to the 23rd. 

Nancy O.

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 04, 2016 Oct 04, 2016

Copy link to clipboard

Copied

I'm still working this out, Nancy. Thank you so much for the help. I'm a javascript newbie trying to wear the big kid's pants.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 04, 2016 Oct 04, 2016

Copy link to clipboard

Copied

OK.  Don't forget to wrap your JavaScript inside <script> </script> tags.

<script>

// QUOTE OF THE DAY SCRIPT: Add 31 quotes or inspirational messages to the array below. Each day a new quote will be displayed.

//***********************

var date    = new Date().getDate();

var quote  = new Array();

quote[1]  = "The mind is everything. What we think we become. --Buddha";

quote[2]  = "Adults are just outdated children. --Dr. Seuss";

quote[3]  = "The secret of getting ahead is getting started. --Mark Twain";

quote[31] = "This is the last quote. No semi-colon after this one."

var Q = Quotation.length;

var whichQuotation=Math.round(Math.random()*(Q-1));

function showQuotation(){document.write(Quotation[whichQuotation]);}

showQuotation();

</script>

Nancy O.

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 06, 2016 Oct 06, 2016

Copy link to clipboard

Copied

LATEST

Okay. Thank you, Nancy. Just having trouble tying each new quote to the right date. Getting closer though, I know. Thank you!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines