Skip to content

Commit

Permalink
date format helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabbir Siddiqui committed Jun 18, 2015
1 parent 07026a9 commit 9977f1a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/assets/javascripts/helpers.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ _.extend PopHealth.Helpers,
else
return value


formatNumber: (value) ->
return String(value).replace(/\B(?=(\d{3})+(?!\d))/g, ",")

##### Handlebars Helpers
Handlebars.registerHelper 'join', (list, options = {}) ->
mappable = if list instanceof Backbone.Collection then list else _(list)
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/templates/providers/show.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</h5>
</div>
<h2>{{providerType}}: {{providerExtension}}, {{title}} {{given_name}} {{family_name}}</h2>
<h2># of Patients: {{patient_count}} </dd> </h2>
<h2># of Patients: {{patient_count_format}} </dd> </h2>

<h4>{{specialty}}</h4>
<h4>{{organization.name}}</h4>
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/views/provider_view.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Thorax.Views.ProviderView extends Thorax.View
providerType: @model.providerType() || ""
providerExtension: @model.providerExtension() || ""
npi: @model.npi() || ""
patient_count_format: PopHealth.Helpers.formatNumber(@model.get('patient_count'))
events:
'click .effective-date-btn' : 'setEffectiveDate'
rendered: ->
Expand Down

0 comments on commit 9977f1a

Please sign in to comment.