This package provides a simple Vue component that renders the current date and time of a given timezone.
This package is meant to be used for the Aheenam Dashboard but you can use this package for your project as well.
Simply add this package using npm/yarn
# using yarn
yarn add aheenam-dashboard-clock
# using npm
npm i -S aheenam-dashboard-clock
This package includes one component Clock
. You can import it in your application and the add it to the list of components. Now you can use it in your template.
<template>
<div>
<clock />
</div>
</template>
<script>
import { Clock } from 'aheenam-dashboard-clock'
export default {
// ...
components: {
Clock
}
// ...
}
</script>
By default the component uses Europe/Berlin
as its timezone. You can change this by providing a timezone
prop.
<clock timezone="AMERICA/LOS_ANGELES" />
You can modify the output of the time and the date by providing the props dateFormat
and timeFormat
By default dateFormat
is ddd MM/DD
and timeFormat
defaults to HH:mm:ss
<clock timeFormat="HH:mm" dateFormat="DD.MM.YYYY" />
As this packages uses moment.js for handling time and dates, refer to its documentation for more details on format values.
Check CHANGELOG for the changelog
To run tests use
yarn test
soon
If you discover any security related issues, please email [email protected] or use the issue tracker of GitHub.
Aheenam is a small company from NRW, Germany creating custom digital solutions. Visit our website to find out more about us.
The MIT License (MIT). Please see License File for more information.