abbott-methods
Version:
abbott,methods,method,functions,function
13 lines (11 loc) • 386 B
text/typescript
import {timeObject} from './timeObject'
/**
* @description 时间的月份
* @param {*} [timeValue]
* @returns {String|Null}
*/
export const timeGetMonth = (timeValue: any = new Date()): string | null => {
const theTime = timeValue || new timeValue()
const theObject = timeObject(theTime)
return theObject !== null ? String(theObject.m).padStart(2, '0') : null
}