Skip to content

Instantly share code, notes, and snippets.

@icambron
Created August 20, 2016 00:30
Show Gist options
  • Save icambron/d7a241bd0f853273aa28a29bbfa32a33 to your computer and use it in GitHub Desktop.
Save icambron/d7a241bd0f853273aa28a29bbfa32a33 to your computer and use it in GitHub Desktop.
<pre><code class="language-js">moment().subtract(<span class="number">10</span>, <span class="string">'days'</span>).calendar();<span class="comment"> // ٩/&rlm;٨/&rlm;٢٠١٦</span>
moment().subtract(<span class="number">6</span>, <span class="string">'days'</span>).calendar(); <span class="comment"> // السبت عند الساعة ٢٠:٣٠</span>
moment().subtract(<span class="number">3</span>, <span class="string">'days'</span>).calendar(); <span class="comment"> // الثلاثاء عند الساعة ٢٠:٣٠</span>
moment().subtract(<span class="number">1</span>, <span class="string">'days'</span>).calendar(); <span class="comment"> // أمس عند الساعة ٢٠:٣٠</span>
moment().calendar(); <span class="comment"> // اليوم عند الساعة ٢٠:٣٠</span>
moment().add(<span class="number">1</span>, <span class="string">'days'</span>).calendar(); <span class="comment"> // غدًا عند الساعة ٢٠:٣٠</span>
moment().add(<span class="number">3</span>, <span class="string">'days'</span>).calendar(); <span class="comment"> // الإثنين عند الساعة ٢٠:٣٠</span>
moment().add(<span class="number">10</span>, <span class="string">'days'</span>).calendar(); <span class="comment"> // ٢٩/&rlm;٨/&rlm;٢٠١٦</span></code></pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment