Countdown/CountUp

Countdown/up counters can be useful to track important upcoming events and to let know your visitors about it.
 
for e.g If you are launching a new application/ web app and have a target date you can use it to display an active counter
 
Parameters
 
  1. "target_date":"1/9/1992",
  2. "counter_type":"y",
  3. "count_direction":"down",
  4. "output_template":" # yrs ago",
  5. "title":"Graduated"
 
1. target_date : This is the date you are setting the count down/up against
 
2. counter_type : This indicates what type of counter display should be.
y: year
m: month
d: day
h: hour
mi : minutes
s: seconds
a: ALL (check later at the bottom)
 
3. count_direction : down or up
 
4. output_template : This is a string template and the current value is substituted into the location where the hash sign is "#"
 
e.g. "# yrs ago" , if the counter value is 5 then the final output string would be 5 yrs ago.
 
5. title:  The tile of the counter
 
Example
 
 
 
The counter value is either decremented or incremented depending on the target date and what is the current date.
 
Some other examples
 
example 1
 
"target_date":"11/1/1999",
"counter_type":"d",
"count_direction":"down",
"output_template":" # days ago",
"title":"Married"
 
 
example 2
 
"target_date":"12/9/2002",
"counter_type":"m",
"count_direction":"down",
"output_template":" # months ago",
"title":""
 
 
example 3
 
"target_date":"3/30/2012",
"counter_type":"mi",
"count_direction":"down",
"output_template":"in # mins",
"title":"Launching"
 
example 4
 
"target_date":"7/14/2011",
"counter_type":"d",
"count_direction":"down",
"output_template":" # days ago",
"title":"Launched"
 
 
example 5
 
"target_date":"6/21/2012",
"counter_type":"a",
"count_direction":"down",
"output_template":"#m Months, #d days to go ",
"title":"Brinda's Birthday"
 
 
 
 
Counter Type = a
 
Consider the below target value. Let say you want to track the Month, Day, Hours and Mins to a certain target date then you can easily do so using the
counter_type:a value
 
 
"target_date":"9/14/2012 17:30:00",
"counter_type":"a",
"count_direction":"down",
"output_template":" #h Hours and #mi mins to go",
"title":""
 
When you use the "a" then the countdown is calculated for the number of years, then it determines how many months, then it determins how many days, then hours and then minutes and finally seconds
 
It does so by calculating the remainder time and then applies the conversion
 
For e.g if the target date is 9/14/2012 17:30:00 (5.30 on 14th sept)
And let say today is 14th sept but the current time is 15:15 ( 3.15 on 14th sept)
 
Then the year value will be zero, days will be zero, hours will be 2 and minutes will be 15.
 
And then depending on the output_template it can display individual values
 
#y = years
#m = months
#d = days
#h = hours
#mi = minutes
#s = seconds
Use online Web Dashboards in the cloud or download and host your own Dashboards