Logo white

wx-group / juvenile-prosecution

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • juvenile-prosecution
  • ..
  • tabs
  • const.js
  • no message
    6c637641
    wxy authored
    2022-04-23 13:38:20 +0800  
    Browse Code ยป
const.js 415 Bytes
Edit Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
export const WEEK_MAP_EN = {
  'SUN': '0',
  'MON': '1',
  'TUE': '2',
  'WED': '3',
  'THU': '4',
  'FRI': '5',
  'SAT': '6'
}

export const replaceWeekName = (c) => {
  // console.info('after: ' + c)
  if (c) {
    Object.keys(WEEK_MAP_EN).forEach(k => {
      c = c.replace(new RegExp(k, 'g'), WEEK_MAP_EN[k])
    })
    c = c.replace(new RegExp('7', 'g'), '0')
  }
  // console.info('after: ' + c)
  return c
}