Light
Back
  1. Timepicker (utility)

Tags

Extension
Nova 2

Timepicker (utility)

Version 1.0

Reviews

0.0 out of 5 stars

NOTE: Because of formatting issues on the Xtras site, this README may be better viewed at: https://github.com/jonmatterson/nova-ext-timepicker

This extension provides a helper for adding timepickers (using the jQuery Timepicker plugin) to input elements collecting time values. It is intended as a utility for extension writers, skin designers and sim manager comfortable with modifying Nova's view files, and it does not provide any changes to Nova on its own.

Requirements

This extension requires:

  • Nova 2.6+

Installation

Copy the entire directory into applications/extensions/timepicker.

Add the following to application/config/extensions.php:

$config['extensions']['enabled'][] = 'timepicker';

Usage

The simplest way to enable a timepicker is simply to add data-timepicker as an attribute on an element. This will initialize a jQuery.timepicker with no options.

To pass options, simply JSON-encode them (with escaped quotes) as the value of data-timepicker such as:


These can also be written to be passed to the input helper such as:

array(
  'name' => 'chronological_mission_post_time',
  'id' => 'chronological_mission_post_time',
  'data-timepicker' => str_replace('"', '"', json_encode([
    'timeFormat' => 'HHmm',
    'defaultTime' =>  $post ? $post->post_chronological_mission_post_time : '0000'
  ])),
  'value' => $post ? $post->post_chronological_mission_post_time : '0000'
);
JonM

Compatibility

Nova 2.7
This add-on may work with Nova 2.7, but members of the community haven’t confirmed
Nova 2.6
This add-on may work with Nova 2.6, but members of the community haven’t confirmed

Version Info

1.0

Last updated

Links

No reviews