/* 采购新旧逻辑区分时间 */
export const PURCHASE_OLD_APPLY_DATE = 240927

export const GET_DATE_NAME = () => {
  const date =  String(PURCHASE_OLD_APPLY_DATE)
  const year = date.slice(0, 2)
  const month = date.slice(2, 4)
  const day = date.slice(4, 6)
  return year + '年' + month + '月' + day + '日'
}

export const GET_PAYMENT_DATE = (payNo = '') => payNo.slice(3, 9) 
export const GET_IS_OLD = (payment_date) => Number(payment_date) < Number(PURCHASE_OLD_APPLY_DATE)
export const getIsBeforeUpdateDate = (payment_date) => Number(payment_date) < Number(PURCHASE_OLD_APPLY_DATE)

export const getDateDetails = () => {
  const date =  String(PURCHASE_OLD_APPLY_DATE)
  const year = date.slice(0, 2)
  const month = date.slice(2, 4)
  const day = date.slice(4, 6)
  return { year, month, day }
}

export const getDateName = () => {
  const { year, month, day } = getDateDetails()
  return year + '年' + month + '月' + day + '日'
}
