Coder Social home page Coder Social logo

datepair's Introduction

typora-copy-images-to typora-root-url
./assets
.

badge badge

DateTime

Here it is

Installation

  1. Install the widget in your project
  2. Include the DateTime widget on a page where you'd like to display an independent date and time picker for a Datetime attribute. Individual widgets Date, and Time are also available, with just their specific set of properties.
  3. Configure the widget: F4033A56-F66C-4A78-9440-75B74C12FB78
  • DateTime : The attribute(s) to use for the Datetimes displayed
  • Editable : Should the fields be editable? (Entity isReadOnlyAttr() will override this.)
Date Settings

A0942FB4-1D46-4029-B175-B240D007FBE6

  • Date Format: the format to display the date. Follow this guide.

  • Earliest Selectable Date: The earliest date a user can select, in days relative to today.

  • Earliest Date Attr : An attribute containing the earliest date a user can select (overrides Earliest Selectable Date)

  • Start Open : Should the control start open?

Date Restrictions

52D4B46E-BF9D-4ABD-A198-266E19CBF955

  • Disabled Days : Days of the week that the user may not select.
  • Date Entity, Microflow, Date Attribute : In conjunction, these properties allow you disable a list of days. Configure a microflow Microflow, such that it returns a list of entities Date Entity, having an attribute Date Attribute. The dates present in Date Attribute will be greyed out in the picker and unavailable for the user to select.
Time Settings

F29E1981-7D6E-463F-A756-4831AC17C11A

  • Time Format : The format to display the time. Follow this guide.
  • Interval : Interval of times to select (in minutes)
  • Earliest Selectable Time : Enter an integer to have the earliest selectable time be relative to now, or a 24h time.
Time Restrictions

96A8138E-2874-49E9-8392-8A7E6C277000

Time Entity, Times Microflow, Time Attribute : In conjunction, these properties allow you disable a list of days. Configure a microflow Times Microflow, such that it returns a list of entities Time Entity, having an attribute Time Attribute. The times present in Time Attribute will be greyed out in the picker and unavailable for the user to select.

Disabled Times : Comma-separated list of times, in 24h format.

Typical usage scenario

  • For better control over the UI when a user needs to pick a date or time.

Known Limitations

  • none at this time.
Based on the Mendix Widget Boilerplate

See AppStoreWidgetBoilerplate for an example

datepair's People

Contributors

cdcharlebois avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

datepair's Issues

Date Box Is Grayed Out

In our implementation of this widget, we're experiencing some weird issues. Even though the field is editable and we can click on it to edit, it is grayed out - like it isn't editable. In other words, the text box that has the date displayed has a gray background instead of a white one.

Earliest and Latest Date Attribute issue

When just the Earliest Date Attribute is set the widget doesn't reflect the value. I have tried CurrentDateTime, BeginningOfCurrentDay and -1 day on both respectively.

When both the earliest (EG BeginningOfCurrentDay) and latest (EG addDays(BeginningOfCurrentDay, 14)) attribute is set the entire calendar is greyed out and it goes back to the year 1970.

The values can be retrieved on the page through text widgets and the values are what I expected.

Mendix Version: 8.9

image

Refresh context object makes values disappear

When you refresh the context object, in Mx 7.9.0 and 7.13.1, the widget does not render the date and time values anymore. Somehow, this also breaks the rendering / value of the object when you show a default date picker.

On https://datetimerefreshiss.mxapps.io you can see the behaviour:

  1. See that the date and time are filled
  2. Press refresh
  3. Notice that the date and time are not rendered

On the right side of the screen, the normal mendix date picker is shown and keeps the values.

I made a change to line 352:

_setDateTimePickerValues: function(datetime) {
datetime = this._contextObj.get(this.fromDate);
....
}

To make sure the values are obtained from the context object.

Should render a little better

The date and time fields should expand to full width (like regular controls) and the validation feedback bar should be below them

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.