Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

fish-helper

a-drowned-fish289MIT0.0.47TypeScript support: included

a tool to process time

js Utils

readme

npm install fish-helper
const helper = require('fish-helper')
Method Description
add(hour, start) Add hour from start date, return timestamp.
offset_time(date, type) The time difference (absolute value), returns the corresponding string.
before_lt_hour(date, hour) The date is less than now, and the date is less than hour from now.
before_gt_hour(date, hour) The date is less than now, and the date is greater than hour from now.
after_lt_hour(date, hour) The date is greater than now, and the date is less than hour from now.
after_gt_hour(date, hour) The date is greater than now, and the date is greater than hour from now.
is_current_year(date) Return boolean.
get_time_obj(date) Return object that includes keys: year, month, day, hour, minute, seconds, day_of_week.
format_count({num, divide, suffix, show_suffix_always}) Return num or string or 0.
format_num2date(timestamp) Convert time to object; return object that includes keys: day, hour, minute, seconds.
count_down(date, fn) End time countdown, end time can be passed in by itself; fn is a callback function that takes a remaining time argument; return a function to stop the timer.
count_down_by_remain_seconds(fn, seconds) 60-second countdown. Time can pass by itself.
format_thousandth(num) Format the data as a string with thousands of bits.
is_empty(data) Determines whether the data is empty.
poll(fn, minute) Execute fn function every minute, return function to stop the fn.
is_equal(a, b, exact) Return boolean, compare a and b; a and b are any type of data.
sleep(ms) Suspend