@lailao10x/laotime

0.0.19 • Public • Published

laotime

Convert date time to lao language format.
ປ່ຽນເວລາເປັນ format ພາສາລາວ.

Installation

# using npm
npm install @lailao10x/laotime

# using yarn
yarn add @lailao10x/laotime

Usage

# using require
const laotime = require('@lailao10x/laotime');

# using import
import laotime from '@lailao10x/laotime';

Example

const getLaotime = laotime("2021-08-24 08:01");
console.log(getLaotime); // 24 ສິງຫາ 2021

or;

const getLaotime = laotime("2021-08-24 08:03", "D M Y, H:MN:S");
console.log(getLaotime); // 24 ສິງຫາ 2021, 08:03:00

or;

const getLaotime = laotime("2021-08-24", "D M Y, H:MN:S");
console.log(getLaotime); // 24 ສິງຫາ 2021, 08:03:00

or;

const getLaotime = laotime(new Date(), "D/M/Y, H:MN:S");
console.log(getLaotime); // 24/ສິງຫາ/2021, 08:03:00

or;

const getLaotime = laotime(new Date().getTime(), "D M Y, H:MN:S");
console.log(getLaotime); // 24 ສິງຫາ 2021, 08:03:00

or;

const getLaotime = laotime(new Date(), "W");
console.log(getLaotime); // ພະຫັດ

or;

const getLaotime = laotime();
console.log(getLaotime); // ສະແດງວັນເວລາປະຈຸບັນ

Tokens and meanings are as follows:

Token Meaning
D or date or DATE Date
M or month or MONTH Month
Y or year or YEAR Year
H or hour or HOUR Hour
MNor minute or MINUTE Minute
S or second or SECOND Second
W or week_day or dayor WEEK_DAY Week day

Messaegs

ຖ້າຫາກວັນເວລາທີ່ປ້ອນເຂົ້ານັ້ນບໍ່ຖືກຕ້ອງ laotime ຈະສົ່ງຄ່າກັບ Invalid Data

Readme

Keywords

Package Sidebar

Install

npm i @lailao10x/laotime

Weekly Downloads

1

Version

0.0.19

License

MIT

Unpacked Size

7.71 kB

Total Files

4

Last publish

Collaborators

  • sksouk
  • joy29lao
  • soulinmaikadua
  • kayengxiong
  • mk89
  • lailaolab