This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers. For more details and for information how to disable the error reporting see Sentry-Plugin Documentation! Sentry reporting is used starting with js-controller 3.0.
The goal of the adapter is to provide you a possibility to run countdowns for future events, with years, months, days, hours and minutes. It will provide you each of those valies seperately, and also two strings with a short and long version of the date.
The adapter provides you automatically a json table and as a HTML table. For the json, please choose the widget "basic-table". For the html, choose the "basic - string (unescaped)" one.
It is possible to either display the short text or the long text.
There are two ways to set up countdowns:
- You can create a countdown in the adapter settings, in the tab "Create Countdown".
- You can create a manual state in the device "setup". The name of the object is the alarm name, and the value will be the date. The date neets to be in the format "DD.MM.YYYY HH:mm:ss".
- You can create an alarm with sendto. There, you can either send the components (minimum is Year Month Date) or a date string. For the date string, you can adjust the format in the setup of the adapter.
- You can add days, months and years with sendto to todays date. Therefore, please send the component "name" and either "addminutes", "addhours", "adddays", "addmonths" or "addyears" as int value.
You can delete a countdown with the sendto. Therefore, send just the name with sendto to the adapter, and the countdown will be deleted automatically.
If you want a countdown to repeat in a defined period (e.g. you cant a countdown for your wedding day every year) you can also do this with this adapter. Therefore either fill the field "Repeat period" in the settings of the adapter, or add the period after the date when you create a countdown with the type "date". A sendTo would look like that for a countdown which should end on the 1st of April 2020 and repeat every year:
sendTo("countdown.0", "send", { "name": 'Wedding Day', "date": '01.04.2020 00:01+1Y' });
Newly added is the feature to "count up" - so to count the days from a date in the past. This can be done either in the adapter setup, or with adding a "#" to a date string, e.g.
sendTo("countdown.0", "send", { "name": 'Birthdate', "date": '01.04.2020 00:01# });
Parameters here are:
- Y: Years
- M: Months
- D: Days
- H: Hours
- m: Minutes
Data type | Description |
---|---|
minutes | Minutes until countdown end (not total!) |
hours | Hours until countdown end (not total!) |
days | Days until countdown end (not total!) |
months | Months until countdown end (not total!) |
years | Years until countdown end (not total!) |
name | Countdown name |
endDate | End date of countdown - formated as in the setup defined |
inWordsShort | Combined value of minutes, hours,... - e.g. 1Y 5M 4D |
inWordsLong | Combined value of minutes, hours,... - e.g. 1 Year 5 Months 4 Days |
totalHours | Total no. of hours until the end date |
totalDays | Total no. of days until the end date |
totalWeeks | Total no. of weeks until the end date |
totalMonths | Total no. of months until the end date |
totalYears | Total no. of years until the end date |
|reached|Boolean field defining if the end date was reached or not| |repeatEvery|Countdown is repeted by this period after reaching the enddate|
- Possibility to add a script as a parameter and start it when countdown ends
- Possibility to use plus and minus in addminutes and the other add functions
- (jack-blackson) Ability to use the countdown "backwards" - e.g. for calculating age of a baby
- (jack-blackson) Adjustments for "in words" -> fixed year/years and adjusted which detail level is shown at which point of time
- (jack-blackson) Bugfix month calculation
- (jack-blackson) Added objects for total number of months and years
- (jack-blackson) Reworked adapter due to wrong process layout
- (jack-blackson) Added headers for HTML and JSON
- (jack-blackson) Bugfix date calculation (thanks to Lueghi for the hint)
- (jack-blackson) Updates for dependencies
- (jack-blackson) Bugfix to delete countdown with sendto
- (jack-blackson) Small bugfixes, translations
- (jack-blackson) Small bugfixes, translations
- (jack-blackson) Small bugfixes, added weblate for translations
- (jack-blackson) Small Bugfixes
- (jack-blackson) Updated packages, added Sentry
- (jack-blackson) Fixes for JS-controller 3.3
- (jack-blackson) Fix that countdowns are created immediatly
- (jack-blackson) bugfix Read-Me link
- (jack-blackson) bugfix repeatCycle
- (jack-blackson) Bugfix log messages
- (jack-blackson) Repeat countdown in defined period (e.g. every year)
- (jack-blackson) Added new date-type for settings: YYYY-MM-DD
- (jack-blackson) Add countdown directly in adapter settings
- (DutchmanNL) Fixed adapter type
- (jack-blackson) Bugfix for alarm at midnight -> thanks to @Lueghi
- (jack-blackson) Reordered release infos
- (jack-blackson) Changes for Compact Mode
- (jack-blackson) Various bugfixes
- (jack-blackson) Having multiple instances of the adapater are now possible
- (jack-blackson) Release version
- (jack-blackson) Bugfixes
- (jack-blackson) addminutes and addhours are now also possible
- (jack-blackson) datapoint in setup is now editable
- (jack-blackson) added total no. of weeks
- (jack-blackson) adjustable date format for input and output
- (jack-blackson) delete countdowns with sendto
- (jack-blackson) ability to add countdowns by "days/months/weeks from now)
- (jack-blackson) adjust the data in the table
- (jack-blackson) bugfix date import
- (jack-blackson) restructuring - creation of alarms with sendto or manually with datapoint is now possible
- (jack-blackson) added total No. of days and hours
- (jack-blackson) adjusted packages
- (jack-blackson) initial version
The MIT License (MIT)
Copyright (c) 2019-2023 jack-blackson [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.