ForgeComponents
en

Components

j-Clock

jComponent 20 · jcomponent@20 component Example loaded with jComponent 20
  • supports dark mode
  • works only with Bootstrap Grid System (otherwise is need to fix CSS)
  • thanks weareoutman for some things

Configuration:

  • twelvehour {Boolean} (optional) the clock will be 12-hour (default false).

Usage

var ELEMENT = $(document);
var PATH = 'some.path.to.date';
var X_OFFSET = 100;

SETTER('clock', 'toggle', ELEMENT, PATH, function(date) {
	console.log('SELECTED DATE:', date);
}, X_OFFSET);

Use it with <ui-component name="clock">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Denis Granec. Source: the Componentator components repository, MIT license.

example.html
<a href="#clock">SHOW CLOCK</a>
<ui-component name="clock"></ui-component>

<script>
	var form = {};
	form.date = new Date();

	$('a[href="#clock"]').on('click', function(e) {
		SETTER('clock', 'toggle', $(this), form.date, function(date) {
			alert(date);
		});
	});
</script>