@mineru98/alpinejs-moment
v1.0.3
Published
An alpine.js magic helper plugin wrapper for moment.js + locale
Downloads
1
Readme
Alpine.js plugin Moment With Locale
An Alpine JS Moment Plugin lets you programmatically monitor changes to the size of the screen
Instalation
Via script include
<!-- You can choose the Locale. -->
<!-- Alpine Plugins -->
<script src="/js/moment.min.js" defer></script>
<!-- Alpine Plugins with Locale -->
<script src="/js/ko/moment.min.js" defer></script>
<!-- Alpine Plugins with Locale -->
<script src="/js/jp/moment.min.js" defer></script>
<script src="/js/alpine.js" defer></script>
Via CDN
<!-- You can choose the Locale. -->
<!-- Alpine Plugins -->
<script
src="https://unpkg.com/@mineru98/[email protected]/dist/moment.min.js"
defer
></script>
<!-- Alpine Plugins with Locale -->
<script
src="https://unpkg.com/@mineru98/[email protected]/dist/ko/moment.min.js"
defer
></script>
<!-- Alpine Plugins with Locale -->
<script
src="https://unpkg.com/@mineru98/[email protected]/dist/jp/moment.min.js"
defer
></script>
<!-- Alpine Core -->
<script defer src="https://unpkg.com/[email protected]/dist/cdn.min.js"></script>
Via NPM
npm i @mineru98/alpinejs-moment
import Alpine from "alpinejs";
import moment from "@mineru98/alpinejs-moment/ko";
Alpine.plugin(moment);
window.Alpine = Alpine;
window.Alpine.start();
$moment()
Magic Helper
<div x-data x-text="$moment().format('YYYY-MM-DD dddd')"></div>