• I live in Spain
  • I am Male

Hello. I'm an Admin from the Final Fantasy Wiki. I saw you recently added some coding to the page for Countdowns and wanted to approach you to ask how to code a particular type of countdown.

The mobile game "Final Fantasy Record Keeper" has special event dungeons that rotate regularly. Most of them rotate on specific days every way, but a new type of dungeon changes every two days regardless of actual date. Is there a way to code a timer to display when the indicated time will arrive, and then roll over to the next indicated time? For instance, "The Bravery Mote dungeon is available on <January 2nd-3rd>" and then on those days it just says something like "The Bravery Mote dungeon is currently available" and on the 4th it changes to reading the next day it re-opens, and so forth, updating itself automatically when appropriate without a user having to manually input and change the dates every couple of days.

Can this be done, and if so, could you show me how, please? DrakeyC (talk) 03:37, December 28, 2017 (UTC)

  • Here's a basic structure, you'll need to adapt it to your needs:
var startDate = new Date("2018-01-02"),
now = new Date();
var diff = (now - startDate) / 1000 / 60 / 60 / 24;
if (diff < 0) {
    if (diff == -1) {
        // The event begins tomorrow
    } else {
        // The event begins in (-1*diff) days
} else {
    var day = diff % 3; // Every round of the event lasts 3 days:
                        // 2 for the actual event + 1 rest day
    if (day == 0) {
        // This is the first day of the event
    } else if (day == 1) {
        // This is the second day of the event
    } else if (day == 2) {
        // Event finished yesterday but a new one starts tomorrow

I wrote the code as clearest as possible but please feel free to ask if you have any doubts about it. Jorgemg14 (talk) 17:39, December 28, 2017 (UTC)

Thanks, I'll have the coder for the Wiki have a look. DrakeyC (talk) 02:20, December 29, 2017 (UTC)
Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+