momentjs iOS

In this example below you will see how to do a momentjs iOS with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by lu1ssuarez, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright lu1ssuarez ©

Technologies

  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>momentjs iOS</title>
  
  
  
  
  
</head>

<body>

  <div id="app">
  {{moment(startDate)}}
</div>
  <script src='https://npmcdn.com/moment@2.18.1/min/moment-with-locales.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.13/moment-timezone-with-data.min.js'></script>
<script src='https://unpkg.com/vue@2.4.2/dist/vue.min.js'></script>

  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/lu1ssuarez/momentjs-ios-QMzwmL */
moment.locale("es_ES");
moment.tz.setDefault("UTC");

new Vue({
  data: {
    startDate: "2017-08-30 16:05:00"
  },
  methods: {
    moment: function($date, $format) {
      return moment($date)
        .tz("America/Caracas")
        .format($format || "DD/MM - hh:mm a");
    }
  }
}).$mount("#app");

Comments