1.1.0 • Published 5 years ago

qjdatetime v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

npm npm

image

QJDatetime

The QJDatetime component provides a method to input dates and time or both in persian system called Jalali. There is also one more version available: QJDatetimePicker. This component have been created just to used in quasar-framework.

Requirements

quasar-framework 17.10.0+

PersianDate library

Installation

First, Install the component by running this command:

npm i qjdatetime

Now, you should make a plugin in your quasar-framework project. It's easy. Just make a file named qjdatetime.js in plugins folder of quasar-framework and add these lines of code to it:

import QJDatetime from 'qjdatetime'

export default ({ app, Vue }) => {
  Vue.use(QJDatetime)
}

You have to edit quasar.conf.js and register the plugin:

{
    "plugins": [
      "qjdatetime"
    ]
}

It's Done. You are ready to enjoy QJDatetime.

Basic Usage

<!-- Only Date -->
<q-j-datetime v-model="model" type="date"/>

<!-- Only Time -->
<q-j-datetime v-model="model" type="time" />

<!-- Date & Time -->
<q-j-datetime v-model="model" type="datetime"/>

Common Usage

<q-j-datetime
    v-model="model"
    float-label="Field Label"
    type="datetime"
    format="YYYY/MM/DD"
    default-view="day"
/>

Vue Properties

Supports v-model which must be a String, Number or PersianDate Object.

Field NameUsageDescription
typeStringOne of date, time or datetime. Default is date.
clearableBooleanIf used, the component offers the user an actionable icon to reset the current value to clear-value (if it is set) or otherwise default-value. The icon appears only when the current value matches clear-value/default-value.
default-valueString/ObjectDefault color for picker when model is not yet set.
clear-valueString/ObjectThe value to which to reset the field model to when using clearable, unless default-value is specified.
minimalBooleanDon’t display header.
readonlyBooleanIf set to true, component is displayed as read-only.
minStringOptional minimum value it can take. Has same format as Datetime model.
maxStringOptional maximum value it can take. Has same format as Datetime model.
default-viewStringOne of ‘year’, ‘month’, ‘day’, ‘hour’, ‘minute’.
default-valueString/Number/PersianDateDefault date/time for picker when model is not yet set.
display-valueStringText to display on input frame. Supersedes ‘placeholder’.
first-day-of-weekNumber0-6, 0 - Sunday, 1 Monday, ….
hide-underlineBooleanAlways display with a Popover, regardless of Platform.
popoverBooleanAlways display with a Modal, regardless of Platform.
modalBooleanAlways display with a Modal, regardless of Platform.
formatStringFormat as described on Handling JS Date page under Format for display section.
format-modelStringData type of model (useful especially when starting out with undefined or null). One of ‘auto’, ‘date’, ‘number’, ‘string’.
format24hBooleanOverride default i18n setting. Use 24 hour time for Material picker instead of AM/PM system which is default.
placeholderStringPlaceholder text for input frame to use when model is not set (empty).
ok-labelStringText for the button to accept the input (when using Modal).
cancel-labelStringText for the button to cancel input with no change (when using Modal).
header-labelStringOverride weekday string on popup. Applies to Material theme only.

Common input frame properties

PropertyTypeDescription
prefixStringA text that should be shown before the value of model.
suffixStringA text that should be shown after the value of model.
float-labelStringA text label that will “float” up above the input field, once the input field gets focus.
stack-labelStringA text label that will be shown above the input field and is static.
colorStringOne from Quasar Color Palette.
invertedBooleanInverted mode. Color is applied to background instead.
inverted-lightBooleanInverted mode with a light color. Color is applied to background instead.
darkBooleanIs component rendered on a dark background?
alignStringOne of ‘left’, ‘center’ or ‘right’ which determines the text align.
disableBooleanIf set to true, component is disabled and the user cannot change model.
warningBooleanIf set to true, the input fields colors are changed to show there is a warning.
errorBooleanIf set to true, the input fields colors are changed to show there is an error.
beforeArrayof Objects Icon buttons on left side of input frame. Read below more details.
afterArrayof Objects Icon buttons on right side of input frame. Read below more details.
no-parent-fieldBooleanAvoid trying to connect to a parent QField.

License

Media-store is free software distributed under the terms of the MIT license.

1.1.0

5 years ago

1.0.6

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago