Metadata-Version: 2.1
Name: j01.daterangepicker
Version: 0.5.0
Summary: DateRange picker widget for z3c.form based on Air Datepicker
Home-page: http://pypi.python.org/pypi/j01.daterangepicker
Author: Roger Ineichen, Projekt01 GmbH
Author-email: dev@projekt01.ch
License: ZPL 2.1
Description: # j01.daterangepicker
        
        DateRange picker widget for `z3c.form`. Wraps Air Datepicker v3.6.0
        (MIT, Timur Borodin).
        
        Two normal `zope.schema.Date` fields are paired into a single
        range-picker UI through the `setUpDateRangePickerWidget` factory.
        Standard `z3c.form` data managers handle the write-back -- no
        custom data manager required.
        
        ## Usage
        
        ```python
        from j01.daterangepicker import setUpDateRangePickerWidget
        
        class MyForm(form.Form):
            fields = field.Fields(IMySchema).select(
                'startDate', 'endDate')
        
            widgetFactories = {
                'startDate': setUpDateRangePickerWidget(
                    'startDate', 'endDate'),
                'endDate':   setUpDateRangePickerWidget(
                    'startDate', 'endDate'),
            }
        ```
        
        Both factory calls use the same `fromName`/`toName` arguments;
        the widget detects on its own which side it is (primary or
        secondary) by comparing `field.__name__` to `fromName`.
        
        Optional min/max constraints and custom validator:
        
        ```python
        setUpDateRangePickerWidget(
            'startDate', 'endDate',
            minDate=datetime.date.today(),
            maxDate=datetime.date(2030, 12, 31),
            validator=myCustomValidator)
        ```
        
        The widget exposes `validateRange(fromValue, toValue)` with an
        in-built `fromValue <= toValue` check; a custom `validator` callable
        is called in addition. Wire the check into the consumer's action
        handler after `extractData()`.
        
        ## Vendor library
        
        Air Datepicker v3.6.0 files are vendored under `cdn/js/` and
        `cdn/css/`. See `LICENSE.txt` for the upstream MIT licence text.
        The locale files in `cdn/js/air-datepicker.locale.<lang>.js` are
        hand-rewrapped from the upstream CJS modules into browser-IIFE form
        so they can be loaded via a regular `<script>` tag without a
        bundler; the locale data itself is verbatim from upstream.
        
        
        # CHANGES
        
        ## 0.5.0 (2026-05-20)
        
        - Initial release. DateRange picker widget for z3c.form wrapping
          Air Datepicker v3.6.0 (MIT, Timur Borodin).
        - Pair-mode wiring through `setUpDateRangePickerWidget`: two
          `zope.schema.Date` fields share one picker UI, standard
          z3c.form data managers write back.
        - ISO-8601 (`YYYY-MM-DD`) on the wire; locale-formatted display
          string driven by the standard `z3c.form` `IDate` converter.
        - Vendored Air Datepicker library files in `cdn/{js,css}/` for
          consumer-side resource registration. Locale files (de/en/fr/it)
          rewrapped as browser IIFEs that attach to
          `window.AirDatepickerLocales[lang]`.
        - Optional `m01.mongo` IMongoDate adapter (zcml:condition).
        
Keywords: J01 datepicker daterange z3c form widget Zope3
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Zope Public License
Classifier: Programming Language :: Python
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Framework :: Zope3
Description-Content-Type: text/markdown
Provides-Extra: test
