@kudzu/alpinejs-moment-timezone
v1.2.0
Published
An AlpineJS plugin wrapper for moment.js with moment-timezone support.
Downloads
101
Readme
Alpine.js plugin Moment-Timezone
An Alpine JS Moment Plugin lets you programmatically monitor changes to the size of the screen
Instalation
Via script include
<script src="/js/moment.min.js" defer></script>
<script src="/js/alpine.js" defer></script>
Via CDN
<!-- Alpine Plugins -->
<script src="https://unpkg.com/@kudzu/[email protected]/dist/moment.min.js" defer></script>
<!-- Alpine Core -->
<script defer src="https://unpkg.com/[email protected]/dist/cdn.min.js"></script>
Via NPM
npm i @kudzu/alpinejs-moment-timezone
import Alpine from 'alpinejs'
import moment from '@kudzu/alpinejs-moment-timezone'
Alpine.plugin(moment)
window.Alpine = Alpine
window.Alpine.start()
$moment()
Magic Helper
<div x-data x-text="$moment().tz('Asia/Bangkok).format('LTS')"></div>