Skip to content

v1.2.0

Compare
Choose a tag to compare
@lukeed lukeed released this 29 Jul 21:52
· 8 commits to master since this release

Features

  • Allow custom patterns (#7, #8): 65a64e5

    You may optionally add new patterns or override existing patterns through tinydate's second parameter. You will still receive a render function – now with your customized functionality!

    Important: Each item of your custom dictionary must be a function~!

    const today = new Date('2019-07-04, 5:30:00 PM');
    
    // Example custom dictionary:
    //   - Adds {MMMM}
    //   - Overrides {DD}
    const stamp = tinydate('Today is: {MMMM} {DD}, {YYYY}', {
    	MMMM: d => d.toLocaleString('default', { month: 'long' }),
    	DD: d => d.getDate()
    });
    
    stamp(today);
    //=> 'Today is: July 4, 2019'

Chores

  • Update and lock devDepdencies versions: fa606ab
  • Update module size (+9 bytes): ac24991