pwix:date
What is it ?
A Meteor package to manage dates formats and conversions.
Should probably rather a NPMJS package. To be done someday.
Installation
This Meteor package is installable with the usual command:
meteor add pwix:date
Usage
1 import { DateJs } from 'meteor/pwix:date';
Provides
DateJs
The exported DateJs
global object provides following items:
Functions
DateJs.configure( o<Object> )
See below
DateJs.i18n.namespace()
Returns the i18n namespace used by the package. Used to add translations at runtime.
Available both on the client and the server.
Configuration
The package's behavior can be configured through a call to the DateJs.configure()
method, with just a single javascript object argument, which itself should only contains the options you want override.
Known configuration options are:
-
verbosity
Define the expected verbosity level.
The accepted value can be any or-ed combination of following:
-
DateJs.C.Verbose.NONE
Do not display any trace log to the console
-
DateJs.C.Verbose.CONFIGURE
Trace
DateJs.configure()
calls and their result
-
Please note that DateJs.configure()
method should be called in the same terms both in client and server sides.
Remind too that Meteor packages are instanciated at application level. They are so only configurable once, or, in other words, only one instance has to be or can be configured. Addtionnal calls to DateJs.configure()
will just override the previous one. You have been warned: only the application should configure a package.
DateJs.configure()
is a reactive data source.
NPM peer dependencies
Starting with v 1.0.0, and in accordance with advices from the Meteor Guide, we no more hardcode NPM dependencies in the Npm.depends
clause of the package.js
.
Instead we check npm versions of installed packages at runtime, on server startup, in development environment.
Dependencies as of v 1.0.0:
1 'lodash': '^4.17.0'
Each of these dependencies should be installed at application level:
meteor npm install <package> --save
Translations
New and updated translations are willingly accepted, and more than welcome. Just be kind enough to submit a PR on the Github repository.
Cookies and comparable technologies
None at the moment.
Issues & help
In case of support or error, please report your issue request to our Issues tracker.
P. Wieser
- Last updated on 2024, Jun. 27th