JavaScript Angular orderBy Date angular order by date,angular orderby date pipe,angular order

I have an array which I want to order by date in Angular.js:

<tr ng-repeat="er in vm.readerFeeds | orderBy:'-publishedDate'">
    <td>{{er.publishedDate}}</td>
</tr>

The list ist not ordered right. I think the date format is the cause?

Date format is:

Sat, 09 Nov 2013 04:26:55 -0800
Answer:1

To make to orderBy to work you need wrap string date with object of new Date(/**/) in controller.

For example:

$scope.vm.readerFeeds = [
 {
  //.....
  publishedDate: new Date(/*your string date*/);
  },
 {
   //.....
  publishedDate: new Date(/*your string date*/);
 }
];
Answer:2

I'm using this expression: "g{field1}={field2}a".match(/{([^\{\}]+)\}/g) What I need is to get "field1" and "field2", but it returns an array with "{field1}" and "{field2}".

I'm using this expression: "g{field1}={field2}a".match(/{([^\{\}]+)\}/g) What I need is to get "field1" and "field2", but it returns an array with "{field1}" and "{field2}".

  1. regular expression match any character
  2. regular expression match string
  3. regular expression match python
  4. regular expression match word
  5. regular expression match number
  6. regular expression match exact string
  7. regular expression match anything
  8. regular expression match multiple words
  9. regular expression match space
  10. regular expression match whitespace
  11. regular expression match period
  12. regular expression match newline
  13. regular expression match substring
  14. regular expression match javascript
  15. regular expression match parentheses
  16. regular expression match end of string
  17. regular expression match special characters
  18. regular expression match all characters
  19. regular expression match group
  20. regular expression match character

Firstly, I have checked these out: How can I get a Google Visulization LineChart to display vertical gridlines? Google Chart: AreaChart vAxis Gridlines is Not Drawing And they don't seem to be quite ...

Firstly, I have checked these out: How can I get a Google Visulization LineChart to display vertical gridlines? Google Chart: AreaChart vAxis Gridlines is Not Drawing And they don't seem to be quite ...

Is there a way to detect all AJAX calls (both GET and POST)? I need to do a generic way to show a loading div while the AJAX call process are running. Something like the code below: $.ajax({ url: '...

Is there a way to detect all AJAX calls (both GET and POST)? I need to do a generic way to show a loading div while the AJAX call process are running. Something like the code below: $.ajax({ url: '...

  1. asp.net generic handler ajax call
  2. ajax call generic handler
  3. jquery ajax generic handler
  4. ajax generic handler

I have a form which has: two input text fields 4 selects 1 textarea Is there an easy way to capture the following event? When a user types inside the input fields, or selects something from the ...

I have a form which has: two input text fields 4 selects 1 textarea Is there an easy way to capture the following event? When a user types inside the input fields, or selects something from the ...

  1. javascript know event listeners