简体   繁体   English

将输入类型=日期值传递给日期函数以获取特定格式

[英]Pass input type=date value to date function to get particular format

Is there any way to get input type=date value to javascript date function? 有什么办法可以将输入type = date值获取到javascript date函数?

I have used in HTML: 我在HTML中使用过:

<input type=date ng-model="dueDate">
<input type="time" ng-model="dueTime">
<button class="button button-block" ng-click="upload_duedates(dueDate, dueTime)">Add duedates</button>

In controller inside upload_duedates function I am getting this: 在upload_duedates函数内部的控制器中,我得到了这个:

dueDate = Thu Jun 24 1999 00:00:00 GMT+0530 (India Standard Time)
dueTime = Thu Jun 24 1999 00:00:00 GMT+0530 (India Standard Time)

But I have to change this date format to something like: 但是我必须将此日期格式更改为类似以下内容:

dueDate = 24/01/1999 or 24-jan-1999(only dd, mm, yyyy)
dueTime = 00:00:00 (only HH:mm:ss)

Is there any filter/directives in angularjs or any way to solve this? angularjs中是否有任何过滤器/指令或任何解决方案?

There are many source in the web to show that. 网络上有很多资料可以证明这一点。 Eg http://www.angulartutorial.net/2014/04/date-filtering-and-formatting-in.html 例如http://www.angulartutorial.net/2014/04/date-filtering-and-formatting-in.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 input type=&quot;date&quot; 中设置格式和值 - Setting format and value in input type="date" 获取输入类型=日期的值作为字符串 - Get value of input type=date as a string 在模态中获取输入类型=日期的值 - Get value of input type=date inside modal angularjs输入类型日期的日期格式验证 - angularjs date format validation on input type date 如何将“日期”类型的输入值传递给每秒计算和更新年龄的 function - How to pass input value of type 'date' to a function which Calculates and updates age every second JavaScript-使用自定义格式从html输入类型日期和时间获取值 - JavaScript - get value from html input type date and time with customized format 想要在具有特定日期格式的日期值的HTML5中初始化输入类型=“日期”的“最小”属性 - Want to initialise “min” attribute of input type=“date” in HTML5 having date value in specific date format 输入[type = date]格式值在php中动态生成 - input[type=date] format value dynamically generated in php Angular.js <input type=“date”> 更改提交值的格式 - Angular.js <input type=“date”> change format of submitted value 如何将选择选项值传递给输入类型日期 - How can I pass select option value to a input type date
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM