How to use the moment/src/moment function in moment

To help you get started, we’ve selected a few moment examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github taktik / icure-backend / web / icure-ht / app / src / elements / ht-pat / dialogs / mycarenet / ht-pat-mcn-chapteriv-agreement.html View on Github external
_closure(){
                return this.isAgreementSelected && this.displayedParagraph && !this.displayedParagraph.canceled && (!this.displayedParagraph.end || this.api.moment(this.displayedParagraph.end).isAfter(moment())) &&
                    (this.displayedParagraph.start && this.api.moment(this.displayedParagraph.start).isBefore(moment()))
            }
github jonkristian / entur-card / src / entur-card.ts View on Github external
${station_name}
                
                ${destination !== 'unavailable'
                  ? html`  ${destination}`
                  : html``
                }
              

              <div class="entur-row">
                <div class="entur-line">
                  ${line.route}

                  ${this._config.show_human
                    ? this.isNowOrHasBeen(line.due_at) === false
                      ? html`<span class="entur-human is-now">${this._translate('arrives')} ${moment(line.due_at, "HH:mm:ss").fromNow()}</span>`
                      : html`<span class="entur-human has-been">${this._translate('arrived')} ${moment(line.due_at, "HH:mm:ss").fromNow()}</span>`
                    : html``
                  }

                  ${this._config.show_next === true &amp;&amp; next_line.due_at !== line.due_at
                    ? html`
                      <div class="entur-next">
                      ${this._translate('next_route')} <em>${next_line.route}</em> ${this._translate('at')} ${next_line.due_at}
                      </div>`
                    : html``
                  }
                </div>

                ${line.delay &gt; 0
                  ? html`
                    <div class="entur-delay">
                      </div></div>
github taktik / icure-backend / web / icure-ht / app / src / elements / ht-msg / ht-msg-flatrate-invoice.html View on Github external
_getExportPageHeader(data) {

                return `
                    <article class="page" id="">

                        <table class="boderGrey bleft0 bright0">
                            <tbody>
                                <tr class="bleft0 bright0">
                                    <td class="important colorBlue bleft0 bright0 italic" width="33%">`+ this.localize('flatrateMonthlyInvoicing',this.language) +`</td>
                                    <td class="important colorBlue bleft0 bright0 txt-center uppercase italic" width="33%">`+ this.localize('month_' + parseInt(this.reportCurrentDateMomentObject.format('M')), this.language) + ` `+ this.reportCurrentDateMomentObject.format('YYYY')+`</td>
                                    <td class="important colorBlue bleft0 bright0 txt-right small-txt italic lineHeight14px verticalAlignMiddle" width="33%">`+ this.localize('day_' + parseInt(moment().day()), this.language) + ` ` + moment().format('DD') + ` `+ (this.localize('month_' + parseInt(moment().format('M')), this.language)).toLowerCase() + ` ` + moment().format('YYYY') + `</td>

                                </tr>
                            </tbody>
                        </table>

                        <table cellpadding="0" cellspacing="0" class="small-txt boderBottomGrey">
                            <tbody>
                                <tr class="">
                                    <td width="55%">
                                        <span class="bold uppercase">${_.get(this.user, "name", "")}</span><br>
                                        ${_.get(this.hcp, "addresses[0].street", "")} ${_.get(this.hcp, "addresses[0].houseNumber", "")}<br>
                                        ${_.get(this.hcp, "addresses[0].postalCode", "")} ${_.get(this.hcp, "addresses[0].city", "")}<br>
                                        ` + this.localize('inami',this.language) + `: &nbsp;&nbsp; ${_.get(this.hcp, "nihii", "")}<br>
                                        ` + this.localize('adm_ctc_per',this.language) + `: &nbsp;&nbsp; ${_.get(this.hcp, "contactPerson", "")} &nbsp;&nbsp; ${_.get(this.hcp, "addresses[0].telecoms[0].telecomNumber", "")}<br>
                                    </td>
                                    <td width="45%"></td></tr></tbody></table></article>
github taktik / icure-backend / web / icure-ht / app / src / elements / ht-msg / ht-msg-flatrate-invoice.html View on Github external
},
                    oaData: {
                        type: Array,
                        value: () => []
                    },
					archiveListingMessages:{
						type:Object,
						value: {}
                    },
                    downloadFileName: {
                        type: String,
                        value: ""
                    },
                    reportCurrentDateMomentObject: {
                        type: Object,
                        value: moment()
                    },
                    reportMonthGap: {
                        type: Number,
                        value: 1
                    }
                };
            }
github taktik / icure-backend / web / icure-ht / app / src / elements / ht-msg / ht-msg-flatrate-invoice.html View on Github external
                            list3 : _.compact(_.map(OaPatients, pat=>{ return parseInt(_.size(_.filter(_.get(pat, "medicalHouseContracts", []), mhc=>{ return moment( _.get(mhc, "endOfContract", 0), 'YYYYMMDD').startOf('month').isSame( moment().subtract(this.reportMonthGap, 'month').startOf('month') ) }))) ? pat : false })),
github taktik / icure-backend / web / icure-ht / app / src / elements / dynamic-form / health-problem-selector.html View on Github external
_isChronical(start, end){
        return moment(start).isSameOrBefore(moment(end).subtract(6, "month"))
	}
github taktik / icure-backend / web / icure-ht / app / src / elements / ht-msg / ht-msg-flatrate-invoice.html View on Github external
return parseInt(_.size(_.filter( _.get(pat, "medicalHouseContracts", []), mhc=>{return(
                                    !!_.trim( _.get(mhc,"suspensionReason","")) &&
                                    ( parseInt(_.get(mhc,"startOfSuspension",0)) && moment( _.get(mhc,"startOfSuspension",0)+"", "YYYYMMDD" ).isBefore( moment() ) ) &&
                                    ( !parseInt(_.get(mhc,"endOfSuspension",0)) || moment( _.get(mhc,"endOfSuspension",0)+"", "YYYYMMDD" ).isAfter( moment() ) )
                                )}))) ? pat : false
                            }))
github taktik / icure-backend / web / icure-ht / app / src / ht-main.js View on Github external
}); //todo refaire reduce
              messages.rows.sort(function (a, b) {
                  return a.status &amp;&amp; (1 &lt;&lt; 0) - b.status &amp;&amp; 1 &lt;&lt; 0;
              });
              return messages.rows;
          }).then(messages =&gt; this.set('messages', messages || []));

          this.api.bemikrono().appointments(parseInt(moment().format('YYYYMMDD'))).then(appointments =&gt; {
              return appointments &amp;&amp; this.api.patient().getPatients(new models.ListOfIdsDto({ ids: appointments.map(a =&gt; a.patientId) })).then(patients =&gt; {
                  //todo wtf JSON not valid
                  patients.forEach((p, idx) =&gt; appointments[idx].patient = p);
                  return appointments;
              });
          }).then(appointments =&gt; this.set('appointments', appointments || []));

          const start = parseInt(moment().subtract(1, 'month').format('YYYYMMDD'));
          const end = parseInt(moment().add(1, 'month').format('YYYYMMDD'));
          const maxplanningsize = 10;
          const sort = 'valueDate';
          const desc = 'desc';

          const planningFilter = { '$type': 'UnionFilter', 'filters': [{ '$type': 'ServiceByHcPartyTagCodeDateFilter', healthcarePartyId: hcp.id, tagCode: 'planned', tagType: 'CD-LIFECYCLE', startValueDate: start, endValueDate: end }, { '$type': 'ServiceByHcPartyTagCodeDateFilter', healthcarePartyId: hcp.id, tagCode: 'planned', tagType: 'CD-LIFECYCLE', startValueDate: start * 1000000, endValueDate: end * 1000000 }] };
          this.api.contact().filterServicesBy(null, null, 1000, new models.FilterChain({ filter: planningFilter })) //todo wtf JSON not valid
          .then(planningList =&gt; {
              const svcDict = planningList.rows.reduce((acc, s) =&gt; {
                  const cs = acc[s.id];
                  if (!cs || !cs.modified || s.modified &amp;&amp; this.api.after(s.modified, cs.modified)) {
                      acc[s.id] = s;
                  }
                  return acc;
              }, {});
              const services = _.sortBy(Object.values(svcDict).filter(s =&gt; !s.endOfLife), [s =&gt; +this.api.moment( /*s.modified||s.created||*/s.valueDate)]);
github taktik / icure-backend / web / icure-ht / app / src / ht-app.html View on Github external
parseDate(s) {
                                    return moment(s, 'DD/MM/YYYY').toDate()
                                },
                                formatTitle(monthName, fullYear) {
github taktik / icure-backend / web / icure-ht / app / src / elements / ht-msg / ht-msg-mycarenet.html View on Github external
formatDate: function (d) {
                                    //return moment(d).format(moment.localeData().longDateFormat('L'))
                                    return moment(d).format('DD/MM/YYYY');
                                },
                                parseDate: function (s) {