sammy-utility
v1.0.22
Published
Sammy Utility
Downloads
27
Readme
Intro
Mini helper for beginner & small project
Table of Contents
Installation
$ npm i sammy-utility
Require Library
$ npm i --save immutable block-ui
Setting all to global on webpack
//main.js(create-react-app) or endpoint
import 'block-ui';
//Webpack
plugins: [
...
new webpack.ProvidePlugin({
jQuery: 'jquery',
$: 'jquery',
jquery: 'jquery',
moment: 'moment',
swal: 'sweetalert2',
axios: 'axios'
})
...
]
Or -> html
<!-- CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css" />
<!-- JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.1/moment.min.js"></script>
Helper Lists
import {
_system,
_services,
_jqueryHelper,
_convert,
_react,
_angular
} from 'sammy-utility';
_convert
import { _convert } from 'sammy-utility';
_convert.dateFormat(new Date(),"YYYY-MM-DD hh:mm:ss");
_convert.sectoHHMMSS(60); //=> 00:01:00
_convert.sectoHHMMSS2(60); //=> 01m:00s
_convert.sectoHHMMSS3(60); //=> 01:00