Skip to content

Commit

Permalink
Issue #611 - added a ordinal indicator function
Browse files Browse the repository at this point in the history
  • Loading branch information
ccene committed Jul 22, 2018
1 parent 7aac6b1 commit be174e4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
Expand Up @@ -3,6 +3,23 @@ import PropTypes from 'prop-types'
import Select from 'react-select'
import { determinePosition } from '/imports/both/collections/events/helpers'

function getOrdinalIndicator(dayInMonth) {
//dayInMonth outputs a number from 1-31
//add endings to number (nth,rd,th,st)
if(dayInMonth>3 && dayInMonth<21) return `${dayInMonth}th`
switch(dayInMonth%10){
case 1:
return `${dayInMonth}st`
case 2:
return `${dayInMonth}nd`
case 3:
return `${dayInMonth}rd`
default:
return `${dayInMonth}th`
}

}

class RecurrMonthly extends Component {
render () {
const {
Expand Down
Empty file.
13 changes: 0 additions & 13 deletions tests/unit-tests/meteorMocks/mdg:validated-method.js

This file was deleted.

Empty file.
3 changes: 0 additions & 3 deletions tests/unit-tests/meteorMocks/meteoreact:accounts.js

This file was deleted.

0 comments on commit be174e4

Please sign in to comment.