Questions tagged [angular-moment]

AngularJS directive and filters for Moment.js. Angular moment provides the `am-time-ago` directive and a number of filters that include `amParse`, `amFromUnix`, `amUtc`, `amUtcOffset` and `amLocal`. Make sure to include momentjs and angularjs tags along with this tag.

Angular moment is a plugin that adds the following directives and filters to AngularJS based on the moment.js library.

  • Directives
    • am-time-ago - Use to format relative timestamps
  • Filters
    • amDateFormat - Format a date using moment.js format() method
    • amDurationFormat - Format a duration in a human readable format
    • amCalendar - Format a date using moment.js calendar() method
    • amTimezone - Apply a timezone to the given date or moment object
    • amLocal - Change the given moment object to be in the local timezone
    • amUtc - Create or switch the current moment object into UTC mode
    • amUtcOffset - Use the given UTC offset when displaying a date
    • amFromUnix - Convert a unix-timestamp into a moment object
    • amParse - Parse a custom-formatted date into a moment object
    • amAdd - Add hours, minutes or seconds from the specified date.
    • amSubtract - Subtract hours, minutes or seconds from the specified date.
    • amDifference - Get the difference between two dates in milliseconds
    • amStartOf - Mutate the original moment by setting it to the start of a minute, hour or day of time.
    • amEndOf - Mutate the original moment by setting it to the end of a minute, hour or day of time.

References

Related Tags

197 questions
-1
votes
1 answer

get all day between 2 timestamp

i am trying to get all day between 2 timestamp and for specific day name. i have a start1 is moment(first date) and end1 is moment(last date). And i have a list of day with id (day). this.datesDailySelected = []; var start1 = moment(new…
jack ros
  • 29
  • 1
  • 7
-1
votes
1 answer

How to change angular-moment locale?

I'm trying to use French version of moment, but moment.locale('fr') doesn't work and it doesn't change the language: console.debug(moment.locale()); moment.locale('fr');…
Ace
  • 420
  • 2
  • 8
  • 25
-1
votes
2 answers

Angular: Exclude time in Date comparison

Here this.startDate.value is Sun Aug 30 2020 05:30:00 GMT+0530 (India Standard Time) and this.endDate.value is Sun Aug 30 2020 00:00:00 GMT+0530 (India Standard Time). Since the time is different, comparison is working in this case. if…
Limna
  • 17
  • 5
-1
votes
1 answer

Moment toJSON does not consider timezione

I've angular application with moment@2.24.0. I do this simple actions: let test = moment('2019112200:00','YYYYMMDDmm:ss'); console.log(test .toJSON()); the result is 2019-11-21T23:00:00.000Z i think it doesn't consider timezone. With…
Pippi
  • 313
  • 1
  • 4
  • 18
-1
votes
3 answers

Exclude weekend dates from working days in JavaScript

So I am kinda stuck in figuring out a certain aspect. What I want to do is the following: Let's say I just have a simple date display, which will show a date such as October 10th, 2017 to an end user. And then there is an option to subtract a…
Lushmoney
  • 412
  • 11
  • 26
-1
votes
2 answers

How to get current program from time ranges

Let's say that i have a JSON file like this [ { "programId": "bla-bla-1", "programTitle": "bla bla 1", "programImg": "bla1.jpg", "startsAt": "Apr 05 2017 11:00:00 GMT+0200 (EET)", "endsAt": "Apr 05 2017…
dyaa
  • 1,440
  • 18
  • 43
-1
votes
1 answer

How to add angularMoment to Rails manifest file?

I'm trying to use angular-moment (https://github.com/urish/angular-moment) in an Angular/Rails applicaton. I've installed angular-moment and angular with bower. Angular works and is being used in the app, but angular-moment crashes the app as soon…
tim_xyz
  • 11,573
  • 17
  • 52
  • 97
-1
votes
1 answer

Momentjs Locale - Day of Week Config for US

I'm using Momentjs in several places in an App I'm working on, and it is working fine. However, I am using endOf('week') and it is resulting in Saturdays. What I am expecting is Sundays. I've been trying to find information about it, but it is not…
Chris
  • 893
  • 10
  • 23
-1
votes
1 answer

How to detect day light saving and convert to BST (local time) in moment js

I am working on a project and suddenly found an issue. Issue was, server is sending Unix timestamps which is GMT but due to daylight saving the date was populated as GMT. It can be achievable from server end but there is very simple way where we can…
Mihir
  • 9
  • 3
-1
votes
2 answers

moment.js in angular is not formatting as I would expect

I have a Time being pulled from a server in the following JSON format: "begins_at":"2016-04-22T08:11:07.000Z" I am using momentjs with angular with the following filter: {{event_details.begins_at | moment: "format": "HH:MM a"}} I would expect the…
Philip7899
  • 4,599
  • 4
  • 55
  • 114
-1
votes
1 answer

AngularJS: setting class dynamically based on time difference

i am comparing time time and based on that i am setting css class name but i made some mistake and that is why code is not working. please anyone see my code and tell me where i made the mistake.
Mou
  • 15,673
  • 43
  • 156
  • 275
-1
votes
1 answer

Angular Moment am-time-ago not returning correct time

i have a time_Sent value like this: 1437203995 for some reason it always returns 45 years ago
teddybear123
  • 2,314
  • 6
  • 24
  • 38
-2
votes
3 answers

Moment date format always returning 01/01/1970 instead of actual date in angular application

Please find attachment. The actual date is 03/06/2019 but the returning formate is always 01/01/1970. How can I resolve this issue? apiData.map(res => { const startDate = moment(res.Issue_Date).format('DD/MMM/YYYY'); const endDate = moment(res.…
imjayabal
  • 805
  • 1
  • 12
  • 24
-2
votes
1 answer

momentjs deprecated warning not going away

somestringvar = moment(entry.expirationDate, "MM/DD/YYYY").format("MMM-DD-YYYY").toString(); The date is correctly converted to the format I need like Nov-11-2018 but I just cannot get rid of that infamous moment js deprecated warning. Tried many…
Gullu
  • 3,477
  • 7
  • 43
  • 70
-3
votes
1 answer

I want to change input format of a timepicker of moment.js from 2018-01-23T12:38:07.439Z to 12:38:07

I am using angular js material for template and angular js for js. and since no timepicker in angular material js I am using a timepicker of moment.js I am using Django as a backend. I am puting data in the database through rest api the code of my…
1 2 3
13
14