Last active
          September 15, 2019 03:25 
        
      - 
      
- 
        Save zerojame/b92cb5a340510a83021156fe2b3c760f to your computer and use it in GitHub Desktop. 
    noti-end-of-month#01
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const moment = require('moment') | |
| const endDateOfMonth = moment().endOf('month').format('DD') | |
| const currentDate = moment().format('DD') | |
| let message = '' | |
| console.log({currentDate, endDateOfMonth}) | |
| if(currentDate == endDateOfMonth) { | |
| message = `วันนี้เป็นวันสิ้นเดือนจ้า เย่เย้ ~~ 😁😁` | |
| } else { | |
| message = `อีก ${endDateOfMonth - currentDate} วัน จะสิ้นเดือน สู้สู้จ้า 🎉🎉` | |
| } | |
| console.log(message) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment