gitana / alpaca

Alpaca provides the easiest way to generate interactive HTML5 forms for web and mobile applications. It uses JSON Schema and simple Handlebars templates to generate great looking, dynamic user interfaces on top of Twitter Bootstrap, jQuery UI, jQuery Mobile and HTML5.
http://www.alpacajs.org
Other
1.29k stars 371 forks source link

AlpacaJS help site should explicitly list required dependencies for date/date time #725

Open navkast opened 4 years ago

navkast commented 4 years ago

IMO, the following pages have less-than-complete documentation:

In both pages, this documentation alludes to the dependencies:

You can learn more about this plugin on its GitHub page: https://github.com/Eonasdan/bootstrap-datetimepicker.
For more information on date and time formatting strings, see the Moment.js documentation: http://momentjs.com/docs/.

However, it's not clear that these dependencies are explicitly required for the subsequent examples to work. In the case where someone just uses cdnjs or some minified css/js files, people might be left wondering why date pickers don't work.

I propose including the following as part of the documentation:

Bootstrap-datepicker and moment.js are required for this feature to work. This is not bundled in our code examples below. Consider importing them. Example:

<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment-with-locales.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
  <link rel="stylesheet" media="screen" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css">

Another request could be to fail hard when these dependencies don't exist and when the date or datetime field types are used. Currently, it fails silently.